1.0.2 • Published 3 years ago
@angelren1220/lotide v1.0.2
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 @angelren1220/lotide
Require it:
const _ = require('@angelren1220/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: assert if two arrays are equalassertEqual: assert if two inputs are equalassertObjectsEqual: assert if two objects are equalcountLetters: count numbers of each letter in a stringcountOnly: count numbers of an item occured in an arrayeqArrays: check if two arrays are equaleqObjects: check if two objects are equalfindKey: find the key with callback as inputfindKeyByValue: find the key by value providedflatten: open the nested arrays of arrayhead: return the first item of the arrayletterPositions: find and return the position of specific letter of a stringmap: customized mapmiddle: return the middle item of an arraytail: return the tail of an arraytakeUntil: take items until the flag/condition and does callbackwithout: take out specific item from the array