1.0.0 • Published 4 years ago
@meghanath/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 @meghanath/lotide
Require it:
const _ = require('@meghanath/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: it will return the head of an arraytail(...)
: it will return the tail of an arraymiddle(...)
: it will return the middle of an arrayassertArraysEqual(...)
: it will assert equal ArraysassertEqual(...)
: it will assert equal expressionsassertObjectsEqual(...)
: it will assert equal objectscountLetters(...)
: count letters in a stringcountOnly(...)
: count only given items to count in an arrayeqArrays(...)
: check if 2 arrays are equaleqObjects(...)
: check if 2 objects are equalfindKey(...)
: find key of object according to the callback functionfindKeyByValue(...)
:find key of object according to the given valueletterPositions(...)
: find letter positions in a stringmap(...)
: new array created according to the functiontakeUntil(...)
: array return take until a particular value appearswithout(...)
: array will return without certain elementsflatten(...)
:a nested array will be flattened to regular array.
1.0.0
4 years ago