1.0.0 • Published 2 years ago
@rj416/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 @rj416/lotide
Require it:
const _ = require('@rj416/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(head)
: find the head of an arraytail(tail)
: find the tail of an arraymiddle(middle)
: find the middle value(s) of an arraytakeUntil(takeUntil)
: take an array until a certain valueassertArraysEqual(assertArraysEqual)
: compare two arraysassertObjectsEqual(assertObjectsEqual)
: compare two objectsassertEqual(assertEqual)
: compare two valuescountLetters(countLetters)
: count letters in a textcountOnly(countOnly)
: count only specified itemseqArrays(eqArrays)
: comparing arrays to evaluate whether they are identicaleqObjects(eqObjects)
: comparing objects to evaluate whether they are identicalfindKey(findKey)
: find the first key that has the specified value or functionfindKeyByValue(findKeyByValue)
: find the first key that has a specific valueflatten(flatten)
: flattens arraysletterPositions(letterPositions)
: lists each letter by positionmap(map)
: takes each item of an array and performs an actionwithout(without)
: removes item(s) from an array.
1.0.0
2 years ago