1.0.0 • Published 4 years ago
@owong-van/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 owong-van/lotide
Require it:
const _ = require('owong-van/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: retrieve first item in an arraytail: except for first item, retrieve all other items in an arraymiddle: retrieve item in the middle of an arrayassertArrayEqual: evaluate two arrays to true if equal, otherwise falseassertObjectsEqual: evaluate two objects to true if equal, otherwise falseassertEqual: evaluate two values to true if equal, otherwise falsecountLetters: return numberof count of a letter in a word or sentenceeqArray: evaluate two arrays to true if equal, otherwise falsecountOnly: given a list of items to return the number of counts of those itemseqObjects: evaluate two objects to true if equal, otherwise falsefindKey: return the first key that met the condition given in an objectfindKeyByValue: return key of specified valueflatten: remove nested array within an arrayletterPositions: return the position(s) of the letter in a stringmap: return new array base on the instructions of the callbacktakeUntil: select and return items in an array base on the criteria of the callbackwithout: return an array after removing items specified in the callback
1.0.0
4 years ago