1.0.0 • Published 1 year ago
@yishan/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 @yishan/lotide
Require it:
const _ = require('@yishan/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function(head)
: find the first element of an arrayfunction(tail)
: find the 2nd till end of all the elementfunction(middle)
: find middle element(s) of an arrayfunction(assertEqual)
: check whether they are equalfunction(assertArrayEqual)
: check whether 2 arrays are equalfunction(assertObjectsEqual)
: check whether 2 objects are equalfunction(countLetters)
: count the number of each wordfunction(countOnly)
: count only the words that requiredfunction(eqArrays)
: check whether 2 arrays are the samefunction(eqObjects)
: check whether 2 objects are the samefunction(findKey)
: find the keyfunction(findKeyByValue)
: find the key using the object valuefunction(letterPositions)
: find the position of the letterfunction(map)
: our own way of map functionfunction(takeUntil)
: take an element from an array until some condiction happenfunction(without)
: return value that not with something
1.0.0
1 year ago