1.0.1 • Published 5 years ago
@ozggnr/lotide v1.0.1
tide
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 @ozggnr/lotide
Require it:
const _ = require('@ozggnr/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: finds the head of an arraytail(...)
: finds the tail of an arraymiddle(...)
: finds the middle item(s) of an arrayassertEqual(...)
: testeqArrays(...)
: find the given arrays are equal or notflatten(...)
: flatten the nested arrayscountOnly(...)
: count the strings found in the input array, if it existeqObjects(...)
: find the given objects are equal or notassertArraysEqual(...)
: test arrayswithout(...)
: return a subset of a given array, removing unwanted elementsmap(...)
: mappingletterPositions(...)
: find the letter positionstakeUntil(...)
: slice of the array with elements taken from the beginningassertObjectsEqual(...)
: test objectscountLetters(...)
: count lettersfindKey(...)
: find the key of the object with given callback functionfindKeyByValue(...)
: find the key of the object with given value