@robbiekt/lotide
v1.0.0
Published
replication of lodash for educational purposes
Downloads
2
Readme
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 @robbiekt/lotide
Require it:
const _ = require('@robbiekt/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: checks to see if two arrays are equalassertEqual(...)
: checks to see if two values are equalassertObjectsEqual(...)
: checks to see if two objects are equalcountLetters(...)
: counts the amount of each letter in a stringcountOnly(...)
: counts only the amounts of elements referenced in the argumentseqArrays(...)
: returns true if the arrays are equaleqObjects(...)
: returns true if the objects are equalfindKey(...)
: finds the key of an object that is described in a callback functionfindKeyByValue(...)
: finds the key of an object by it's valueflatten(...)
: flattens an array (only nested once)head(...)
: finds the first element of an arrayletterPositions(...)
: finds the index of each letter in a stringmap(...)
: replication of the Array.Prototype.map functionmiddle(...)
: finds the middle value in an arraytail(...)
: returns the array without the first elementtakeUntil(...)
: returns the array until the condition of the callbackwithout(...)
: filters out all the unwanted values in an array