@mikedragert/lotide
v1.0.0
Published
implements several functions similar to lodash. Created for learning purposes
Downloads
3
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 @mikedragert/lotide
Require it:
const _ = require('@mikedragert/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(...)
: descriptionfunction2(...)
: descriptionfunction3(...)
: descriptionassertEqual(...)
: assert two values are equalassertArraysEqual(...)
: assert two arrays are equalassertObjectsEqual(...)
: assert two objects are equalhead(...)
: select the head of an arraytail(...)
: select the tail of an arraymiddle(...)
: select the middle of an arraycountLetters(...)
: count the number of each letter and return in an objectcountOnly(...)
: count only the specified itemsdeepFlatten(...)
: flatten an array (recursive so it will handle embedded arrays)eqArrays(...)
: determine if two arrays are equaleqObjects(...)
: determine if two objects are equalfindKey(...)
: find a key in an object based on the provided callbackfindKeyByValue(...)
: find a key in an object based on the provided objectflatten(...)
: flatten an array, only goes one level deepletterPositions(...)
: determine all positions of every letter in the string, does not return positions of " "map(...)
: return a mapped array based on the provided callbacktakeUntil(...)
: return an array up to the first element that matches the given callbackwithout(...)
: return an array, without any elements that are specified in the exclusion array