1.0.0 • Published 3 years ago
@bchau/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 @bchau/lotide
Require it:
const _ = require('@bchau/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertObjectsEqual()
: asserts if 2 objects are equalcountLetters()
: counts each letter in a sentenceassertArraysEqual()
: asserts if 2 arrays are equalhead()
: returns first element of an arrayassertEqual()
: checks if actual and expected values are equalcountOnly()
: finds and counts number of items in a given arrayeqArrays()
: checks if 2 arrays are equaleqObjects()
: checks if 2 arrays are equalfindKey()
: finds key of an object from a given valueletterPositions()
: finds index of each letter in a sentencemiddle()
: returns middle value of an arraymap()
: outputs the output from a given array based on given call backtail()
: returns elements of an array except the first elementtakeUntil()
: returns a new array until by looping in a given array until the given condition does not return truewithout()
: returns an array without those element/s which we do not wantfindKeyByValue()
: finds key of an object from a given value
1.0.0
3 years ago