1.0.0 • Published 3 years ago
@knagayama76/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 @knagayama76/lotide
Require it:
const _ = require('@knagayama76/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual(Array)
: assert return values of two arraysassertEqual(Array)
: assert identical valuesassertObjectEqual(Object)
: assert return values of two objectscountLetters(string)
: take in a sentence and return a count of each of the letters in the sentencecountOnly
: take in a collection of items and return counts for specific subset of itemseqArrays(Arrays)
: compare two arrays are equaleqObjects(Object)
: compare two objects are equalfindKey(Object)
: returns the key of the first elementfindKeyByValue(Object)
: return the first key which contains the given valuehead(Array)
: retrive the first element from the arrayletterPositions(string)
: return all the indicates in the string where each character is foundmap(Array)
: find given word in an arraymiddle(Array)
: retrive the middle element from the arraytail(Array)
: retrive the last element from the arraytakeUntil(Array)
: keep collecting items from a provided arrray until return truthy valuewithout(Array)
: remove unwanted element
1.0.0
3 years ago