1.0.0 • Published 3 years ago
@jeffbushdesign/lotide2 v1.0.0
Lotide
A mini clone of the Lodash library.
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 @jeffbushdesign/lotide
Require it:
const _ = require('@jeffbushdesign/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual()
: assert that 2 arrays are equal or notassertEqual()
: assert that 2 strings or numbers are equal or notassertObjectsEqual()
: assert that 2 objects are equal or notcountLetters()
: takes a string and returns a count of the number of occurances of each letter in the stringeqArrays()
: takes 2 arrays, returns true if they're equal and false if they're not equaleqObject()
: takes 2 objects, returns true if they're equal and false if they're notfindKey()
: takes an object and callback, returns the first key that meets the criteria of the callbackfindKeyByValue()
: takes an object and a value, returns the key that has that valuefindWaldo()
: REMOVEfindWaldoAnonymously()
: REMOVEflatten()
: takes an array containing another array, returns a flattened arrayhead()
: takes an array, returns 1st elementmap()
: receives an array and a callback, returns a new array based on running callback on all array itemsmapTest()
: REMOVEmiddle()
: receives an array, returns middle-most element of arraymin()
: REMOVEpassingGradesOnly()
: REMOVEtail()
: receives an array, returns an array with everything except the first item of the arraytakeUntil()
: receives an array and a callback, returns a slice of the array based on callbackwithout()
: receives an array and an items to remove array, returns array without items in items to remove array
1.0.0
3 years ago