1.0.0 • Published 3 years ago
@vandal19/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 @vandal19/lotide
Require it:
const _ = require('@vandal19/lotide')
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: assert whether two arrays are equalassertEqual(...)
: assert if two values are equalassertObjectsEqual(...)
: assert if two objects are equalcountLetters(...)
: counting the number of specified letter within a specifc stringcountOnly(...)
: counting the number of specified item within an arrayeqArrays(...)
: to check if two arrays are equaleqObjects(...)
: to check if two objects are equalfindKey(...)
: finding the key of an object using callbackfindKeyByValue(...)
: finding the key of an object given its valueflatten(...)
: return a nested array into a single arrayhead(...)
: return the value of the first index in an arrayletterPositions(...)
: return the index of the specified letter within a string in an array based on the individual alphabetmaps(...)
: using callback function to every value inside an arraymiddle(...)
: return the value of the middle index of an arraytail(...)
: return the value of the index of an array except the first onetakeUntil(...)
: return a slice of the array with elements taken from the beginning until it stopswithout(...)
: filtering an array to remove the value of a specified item
1.0.0
3 years ago