1.0.0 • Published 6 months ago
@c22quiambao/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 @c22quiambao/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: retrieve the head of an arraytail(...)
: retrieve the tail of the arraymiddle(...)
: retrieve the middle of an arrayassertArrayEqual(...)
: assertion to check if arrays supplied are equalassertEqual(...)
: assertion to check if supplied expected value actual value are equalassertObjectsEqual(...)
: assertion to check if objects supplied are equalcountLetters(...)
: counts the number of occurences a letter appears on a stringcountOnly(...)
: Counts elements from an array based from an objecteqArrays(...)
: validates if given arrays are equaleqObjects(...)
: validates if given objects are equalfindKey(...)
: finds the object key with the highest key valuefindKeyByValue(...)
: finds the object key given a value elementletterPositions(...)
: retrieves the index/indexes of a letter in stringmap(...)
: creates a new array based from another array by mapping taking only a part of each array elementtakeUntil(...)
: Stop collecting items from an array when the callback returns a truthy valuewithout(...)
: removes items on an array based from another array
1.0.0
6 months ago