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 @kingphazer/lotide
Require it:
const _ = require('@kingphazer/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
head(...)
: returns first element in arraytail(...)
: returns the array minus the first elementmiddle(...)
: returns the middle of an array, two elements maxassertArraysEqual(...)
: assertion test between two arraysassertEqual(...)
: assertion test between primitivesassertObjectsEqual(...)
: assertion test between two objectscountLetters(...)
: counts each letter in a string and returns a count of each unique lettercountOnly(...)
: same as count letters only counts an array of 'items' instead and returns a unique counteqArrays(...)
: checks if two arrays are equalfindKey(...)
: searches for a key in an array with a matching value, and returns the keyfindKeyByValue(...)
: searches for key by valueflatten(...)
: unnests nested arraysletterPositions(...)
: returns letters in the position they first appear in a string, as well as return a count of repeatsmap(...)
: breaks an array into singular arrays and returns set numberstakeUntil(...)
: takes in an array and a user set "break" and only returns array until said breakwithout(...)
: compares two arrays and returns the first array minus similar elements from the second array