1.0.2 • Published 5 years ago
@cernuie/lotide v1.0.2
Lotide
A mini clone of the Lodash library.
Description
Various helpful function made for assignment from Lighthouse Labs
Author
{ "name" : "Alexander Nguyen", "email" : "cernvii@gmail.com"}
Purpose
BEWARE: This library was published for learning purposes. It is not intended for use in production-grade software.
This project was created and published by me as part of my learnings at Lighthouse Labs.
Usage
Install it:
npm install @cernuie/lotide
Require it:
const _ = require('@cernuie/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual
: tests if two elements are equal and logs out a string whether they do or nothead
: returns the first element of an arraytail
: returns everything but the first element of an arraymiddle
: returns the middle of an arrayeqArrays
: returns boolean if two arrays are equaleqObjects
: returns boolean if two objects are equalassertArraysEqual
: logs out string whether array are equal or notassertObjectsEqual
: logs out string whether objects are equal or notfindKey
: finds key in an object using a callback functionfindKeyByValue
: finds key in an object with a given valueindex
: an index of all functions in packageletterPositions
: returns position of a given letter in a string in the form of an arraymap
: given an array and a callback function meant to transform elements of an array, maps the callback function to the arraytakeUntil
: given an array and callback function, returns the elements of an array until callback becomes truthywithout
: takes out elements in an array