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 @leepavelich/lotide
Require it:
const _ = require('@leepavelich/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
countLetters
: returns the count of each letter in a stringcountOnly
: returns the count of the items in an array specified by another arrayeqArrays
: compares two arrays for equality, including subarrayseqObjects
: compares two objects for equality, including subobjectsfindKey
: returns the first instance of a key in an object specified by some callback functionfindKeyByValue
: returns the first instance of a key in an object specified by some valueflatten
: flattens an array of depth 1head
: returns the first element of an arrayletterPositions
: returns an object containing the positions of letters in a string, ignoring spacesmap
: a custom map functionmiddle
: returns the middle elements of an array (length 2 if even)tail
: returns all the non-first elements of an arraytakeUntil
: takes in an array and returns another array of the first n elements up until some callback function becomes truewithout
: takes in an array and returns another array with some specified element filtered out