1.0.0 • Published 4 years ago
@dawecode/lotide 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 @dawecode/lotide
Require it:
const _ = require('@dawecode/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: returns first element of arraymiddle(array)
: returns middle of arraytail(array)
: returns everything after the headwithout(array)
: removes specific element from arraytakeUntil(array,callback)
: return new array until a certain element using a callback and source arrayeqArrays(arr1,arr2)
: comparing two arraysassertArraysEqual(actual,expected)
: comparing two arrays with the help of eqArrayscountOnly(item,itemcount)
: counts only what item you wantcountLetters(string)
:returns a count of each letterletterPositions(string)
:returns all the positions of the letterfindKey(obj,callback)
: finds a key specified by the callbackfindKeyByValue(object,value)
: finds key by valueeqObjects(obj1,obj2)
:compares objectsasserObjectsEqual(actual,expected)
: uses eqObjects to compare actual and expected returns of objectsassertEqual(actual,expected)
: compares actual and expected returnsmap(array,callback)
:return an array based on the results of the callback
1.0.0
4 years ago