1.0.1 • Published 4 years ago
@psyphur/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 @psyphur/lotide
Require it:
const _ = require('@psyphur/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(firstArray, secondArray)
: returns true if 2 arrays are equalassertEqual
: compares an input and an expected output to determine if they are trueassertObjectsEqual
: returns true if 2 objects are the samecountLetters
: count and return number of letters in a stringcountOnly
: count for a specified object within a listeqArrays
: compares 2 arrays to determine if they are the equaleqObjects
: compares 2 objects to determine if they are the samefindKey
: finds the key(s) of given objectfindKeyByValue
: finds the key of a specified objectflatten
: flattens a nested array to a single arrayhead
: returns the first element within an arraytail
: returns the remaining elements within an array minus the firstletterPositions
: returns the index of letters within a stringmap
: maps an arraymiddle
: returns the middle element(s) of an arraytakeUntil
: returns element from an array until a specified conditionwithout
: returns an array without the specified value