1.0.0 • Published 4 years ago
@victorzzz/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 @victorzzz/lotide
Require it:
const _ = require('@victorzzz/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: checks whether eqArrays function is true or falseassertEqual(...)
: checks if actual value is expected valueassertObjectEqual(...)
: checks whether eqObjects function is true or falsecountLetters(...)
: counts letters how many of each letter there are in a stringcountOnly(...)
: count only the values requiredeqArrays(...)
: checks if two arrays are equaleqObjects(...)
: chekcs if two objects are equalfindKey(...)
: find the property key of an objectfindKeybyValue(...)
: find the property key of an object based on the valuehead(...)
: returns first element of an arrayindex(...)
: contains all the funnctions mentioned hereletterPositions(...)
: returns the positions of a stringmap(...)
: loops all elements in an array and returns required index elementsmiddle(...)
: returns the middle elements of an arraytail(...)
: returns all array elements except the first onetakeUntil(...)
: returns all elements before input element equals the current elementwithout(...)
: removes element from a source array when given a value, then returns the remaining elements
1.0.0
4 years ago