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 not -
assertObjectEqual(o1, o2)
: Outputs if the two values are equal or not -
assertArrayEqual(a1, a2)
: Outputs if the two arrays are equal or not -
countLetters(phrase)
: Returns a map of letters to their count in the given phrase -
countOnly(values, filter)
: Returns items and their count that part of filter -
eqArrays(l1,l2)
: Returns true if arrays are equal otherwise false -
eqObjects(o1,o2)
: Returns true if objects are equal otherwise false -
findKey(values, comparison)
: Returns key if given value matches comparison -
findKeyByValue(values, value)
: Returns key if values contain given value -
letterPositions(sentence)
: Returns map of letter to their count -
map(values, conversion)
: Returns a list of values using conversion function -
head(...)
: Returns the head value from the list of values -
tail(...)
: Returns a list of tail values -
middle(...)
: Returns the middle values of the list