@dallas.fraser.waterloo/lotide
v1.0.4
Published
Lighthouse Project Called Lotide
Downloads
2
Maintainers
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 @dallas.fraser.waterloo/lotide
Require it:
const _ = require('@dallas.fraser.waterloo/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual(v1, v2)
: Outputs if the two values are equal or notassertObjectEqual(o1, o2)
: Outputs if the two values are equal or notassertArrayEqual(a1, a2)
: Outputs if the two arrays are equal or notcountLetters(phrase)
: Returns a map of letters to their count in the given phrasecountOnly(values, filter)
: Returns items and their count that part of filtereqArrays(l1,l2)
: Returns true if arrays are equal otherwise falseeqObjects(o1,o2)
: Returns true if objects are equal otherwise falsefindKey(values, comparison)
: Returns key if given value matches comparisonfindKeyByValue(values, value)
: Returns key if values contain given valueletterPositions(sentence)
: Returns map of letter to their countmap(values, conversion)
: Returns a list of values using conversion functionhead(...)
: Returns the head value from the list of valuestail(...)
: Returns a list of tail valuesmiddle(...)
: Returns the middle values of the list