1.0.1 • Published 4 years ago
@hunterapril94/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 @hunterapril94/lotide
Require it:
const _ = require('@hunterapril94/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual: this compares if arrays are equal and throws a message to let you know if it passes or failsassertEqual: compares strings and numbers for equality and throws message to let you know the resultsassertObjectsEqual: compares objects for equality and throws a message to let you know the resultscountLetters: counts letters in a stringcountOnly: counts only specified contenteqArrays: compares arrays for equalityeqObjects: compares objects for equalityfindKey: searches an object for a certain keyfindKeyByValue: searches an object for a key when given its valueflatten: turns nested arrays into one 2d arrayhead: returns the first value in an arrayletterPositions: returns an array with all the positions in which a certain letter occursmap: maps to a new arraymiddle: returns the middle value in an arraytail: returns the final value in an arraytakeUntil: slices an array at a certain given valuewithout: returns an array without a given value