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 itscharisma/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
assertArraysEqual
: Checks if our assertion of arrays are equalassertEqual
: Checks if our assertion of statements are equalassertObjectsEqual
: Checks if our assertion of objects are equalcountLetters
: Counts the letters in a stringcountOnly
: Counts items in an array and adds it to an objecteqArrays
: Checks our array parameters are equaleqObjects
: Checks to make sure our objects are equalfindKey
: Finds the beginning letter of a stringfindKeyByValue
: Search for a key on an object where its value matches a given valueflatten
: Flattens an arrayhead
: Gets the first element of arrayletterPositions
: Return all indices in the string where each character is foundmap
: Return a new array based on the results of the callback functionmiddle
: Grabs the middle of an arraytail
: Grabs all but the first element of arraytakeUntil
: Takes all the values out of an array or string until specified conditionwithout
: Creates an array excluding all given values