1.0.0 • Published 2 years ago
@carbo740/lotide v1.0.0
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 @carbo740/lotide
Require it:
const _ = require('@carbo740/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: asserts if two arrays are equalassertEqual
: asserts if two values are equalassertObjetsEqual
: asserts if two objects are equalcountLetters
: counts the letters in a string and returns it as an objectcountOnly
: counts whatever the user wants from a list of itemseqArrays
: checks if two arrays are equaleqObjects
: checks if two objects are equalfindKey
: finds a key in an objectfindKeyByValue
: finds a key based on its valuehead
: returns the first index of an arraytail;
: returns everything but the first index of an arrayletterPositions
: returns the positions of all the letters in a stringmap
: changes the value of all the elements in the array based on the function executedmiddle
: returns the middle element in an arraytakeUntil
: returns an array based on what value to removewithout
: removes all elements from array based element
1.0.0
2 years ago