1.0.6 • Published 3 years ago
@leventbk/lotide v1.0.6
Lotide :dizzy:
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 @leventbk/lotide
Require it:
const _ = require('@leventbk/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: assertion function for arraysassertEqual: assertion function for primitive valuesassertObjectsEqual: assertion function for objectscountLetters: counts how many of each letter there is in a stringcountOnly: counts only specific values in an arrayeqArrays: comparison function for arrayseqObjects: comparison function for objectsfindKey: finds the key in an object whose value matches a certain criteriafindKeyByValue: finds the key in an object by its valueflatten: flattens a nested array (only for 2-level arrays)head: returns the first value in an arrayletterPositions: returns the positions of letters in a stringmap: a clone of the Array.prototype.map methodmiddle: returns the middle element(s) of an arraytail: returns all the values except the first one of an arraytakeUntil: takes elements of an array until a condition becomes truewithout: returns a copy of an array without certain elements