1.0.0 • Published 3 years ago
@kruciall/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 @kruciall/lotide
Require it:
const _ = require('@kruciall/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: Compares two arrays to see if they are equal - returns true or falseassertEqual: Compares two primitive values - returns true if they are equalassertObjectsEqual: Compares two objects - returns true if they are equalcountLetters: Given a string of letters - retuurns the number of occurencescountOnly: Given an object - returns the number of occurenceseqArrays: Compares two arrays and returns true if they are equaleqObjects: Comapres two objects - returns true if they are equalfindKey: Given an object and callback function - returns first key in which callback function returns a truthy valuefindKeyByValue: Given an object and callback function - identifies the keys valuehead: Retrieves the first element from an arrayletterPositions: Given a string - returns all the indices in the string for each charactermap: Given an array and callback - returns the modified array with callback function appliedmiddle: Given an array - returns the middle element(s)tail: Given an array - returns a new array with the first index element removedtakeUntil: Given an array and callback - returns all matching elements until a different elementwithout: Given an array and value of an array - returns a new array with the elements removed
1.0.0
3 years ago