1.0.0 • Published 2 years ago
@muhtasim.yasser/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 @muhtasim.yasser/lotide
Require it:
const _ = require('@muhtasim.yasser/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: takes in 2 arrays and asserts if 2 arrays are equalassertEqual(...)
: takes in 2 values and asserts if 2 values are equalassertObjectsEqual(...)
: takes in 2 objects and asserts if 2 objects are equalcountLetters(...)
: takes in a string and returns the number of times each letter occurscountOnly(...)
: takes in a string and returns the count of specified letterseqArrays(...)
: takes in 2 arrays and checks if 2 arrays are equaleqObjects(...)
: takes in 2 objects and checks if 2 objects are equalfindKey(...)
: takes in an object and a callback, returns the first key that matches the callback specified in the inputfindKeybyValue(...)
: takes in an object and a value, returns the first key that contains the value specified in the inputflatten(...)
: takes in an array with or without nested arrays flattens the nested arrayhead(...)
: takes in an array and returns the first elementindex
: contains a list of all functions within this lotide packageletterPositions(...)
: takes in a string and returns the position(index) of each letter in an objectmap(...)
: takes in an array and a callback, then applies the callback to that array and returns a new arraymiddle(...)
: takes in an array and returns the middle element(s)tail(...)
: takes in an array and returns the last elementtakeUntil(...)
: takes in an array and a callback returns an array of elements up until the callback conditionwithout(...)
: takes in an array and an argument, returns an array without the specified argument
1.0.0
2 years ago