1.0.1 • Published 6 years ago
@jlampen/lotide v1.0.1
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 @jlampen/lotide
Require it:
const _ = require('@jlampen/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...): Assertion that prints if two arrays are equalassertEqual(...): Assertion that prints if two values are equalassertObjectsEqual(...): Assertion that prints if two objects are equalcountLetters(...): Returns an object that tracks the amount of times each letter appears in a given stringcountOnly(...): Returns an object that tracks the amount of times a specified string appears in an array of stringseqArrays(...): Compares two arrays and returns a boolean 'true' or 'false'eqObjects(...): Compares two Objects and returns a boolean 'true' or 'false'findKey(...): Returns a key from an object that satisfies a specified callback functionfindKeyByValue(...): Returns a key from an object that matches a specified valueflatten(...): Accepts a two-level array of arrays and returns a single-level arrayhead(...): Returns the first item of an arrayletterPositions(...): Returns an object containing the index locations of each letter used in a given stringmap(...): Accepts an array of strings and returns a modified array of those strings based on a specified callback functionmiddle(...): Returns an array containing the middle value(s) of an arraytail(...): Removes the first item of an array and returns a new modified arraytakeUntil(...): Returns an array of items from an inputted array (starting from index 0) up until a condition from a specified callback function is satisfiedwithout(...): Returns an array of items from an inputted array which does not include a specified value(s)