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 @username/lotide
Require it:
const _ = require('@cjepps/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: Checks if two arrays are equalassertEqual(...)
: assert if output of function matches expected outputassertObjectsEqual(...)
: asserts to objects are equalcountLetters(...)
: count occurances of letters in a stringcountOnly(...)
: count occurances of an item if it matches an item in an objecteqArrays(...)
: Checks if two arrays are equaleqObjects(...)
: checks if both objects have identical keys with identical values.findKey(...)
: return the 1st key for which the callback returns truthyfindKeyByValue(...)
: return the 1st key with the valuehead(...)
: return the 1st element in an arrayletterPositions(...)
: return all the indices in the string where each character is foundmap(...)
: return a new array based on the results of the callback functionmiddle(...)
: returns the elements at the middle of an arraytail(...)
: returns all elements in an array except the 1st onetakeUntil(...)
: return a "slice of the array with elements taken from the beginning." It should keep going until the callback/predicate returns a truthy valuewithout(...)
: return a subset of a given array, removing unwanted elements