1.0.1 • Published 2 years ago
@alyshajoy/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 @alyshajoy/lotide
Require it:
const _ = require('@alyshajoy/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...): return the first value of an arraytail(...): return every value of an array except for the first onemiddle(...): return the values in the middle of an arrayassertArraysEqual(...): console log a message that tells you whether or not two arrays are equalassertEqual(...): console log a message that tells you whether or not two values are equalassertObjectsEqual(...): console log a message that tells you whether or not two objects are equalcountLetters(...): returns an object with each letter contained in a string as keys, and how often that letter is found in the string as valuescountOnly(...): counts how often specific values are found in an arrayeqArrays(...): returns true if two arrays are identicaleqObjects(...): returns true if two objects are identicalfindKey(...): returns the first key within an object that contains the specified value when the values are objectsfindKeyByValue(...): returns the first key within an object that contains the specified value when value is primitiveflatten(...): take an array with nested arrays and return an array with the same values, but without any nestingletterPositions(...): returns an object containing each letter of the given string, as well as each letter's position in the stringmap(...): applies given function to each value within an arraytakeUntil(...): return each value of an array until it reaches a specified valuewithout(...): when given two arrays, it returns the first array but with the values of the second array removed