1.0.0 • Published 2 years ago
@yiusifer/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 @yiusifer/lotide
Require it:
const _ = require('@yiusifer/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual(arrayOne, arrayTwo)
: determines if two arrays are equalassertEqual(actual, expected)
: determines if two values are equalcountLetters(word)
: counts number of letters in a given wordcountOnly(allItems, itemsToCount)
: counts number of occurences in an array based on another given valueeqArrays(arrayOne, arrayTwo)
: determines if two arrays are equaleqObjects(actual, expected)
: determines if two objects are equalfindKey(object, callBack)
: finds key based on callbackfindKeyByValue(object, value)
: returns value of given key based on value givenmap(arr, callBack)
: similar to .map functiontakeUntil(array, callback)
: slices from an array until stop condition is metwithout(source, itemsToRemove)
: slices an array based on itemsToRemovehead(array)
: takes first index of an arraytail(array)
: takes everything other than index 0 from an arraymiddle(array)
: takes middle value(s) from an array
1.0.0
2 years ago