A mini clone of the Lodash library.
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.
Install it:
npm install @wmlimanto/lotide
Require it:
const _ = require('@wmlimanto/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
assertArraysEqual(...)
: assert whether two arrays are equalassertEqual(...)
: assert whether two values are equalassertObjectsEqual(...)
: assert whether two objects are equalcountLetters(...)
: count the number of letters in a sentence stringcountOnly(...)
: count the number of specified items in an arrayeqArrays(...)
: check whether two arrays are an exact matcheqObjects(...)
: check whether the key-value pairs of two objects are identicalfindKey(...)
: find the first key of an object through a callback functionfindKeyByValue(...)
: find the first key of an object given its value pairflatten(...)
: return nested arrays into a single arrayhead(...)
: return the value of the first index in an arrayletterPositions(...)
: return an array of all the indices of a specified letter within a sentence stringmap(...)
: return a new array based on the results of the callback functionmiddle(...)
: return the value of the middle-most index in an arraytail(...)
: remove the first index of an array and return the new arraytakeUntil(...)
: return a slice of an array with elements taken from the beginning until the value matches a callback functionwithout(...)
: return a subset of a given array and remove unwanted items