@oliviaanderson/lotide
v1.0.1
Published
A mini clone of the [Lodash](https://lodash.com) library
Downloads
148
Readme
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 @oliviaanderson/lotide
Require it:
const _ = require('@oliviaanderson/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head()
: returns the first element of an arraytail()
: returns the remainder of the array after the first elementmiddle()
: returns the center element of an odd-numbered array and the middle two elements of an even numbered arrayassertEqual()
: compares two arguments to determine if they are equaleqArrays()
: compares two arrays to determine if they are equalassertArraysEqual()
: uses eqArrays to form a statement on equality between two arrayscountOnly()
: counts each element in an array and increases count for repeated elementscountLetters()
: counts each letter in a string and increases count for repeated letterseqObjects()
: compares two objects to determine if they are equalfindKey()
: uses a callback to find a key in an objectfindKeyByValue()
: uses the value of a key to find a key in an objectflatten()
: returns one single array which contained arrays with limited scopeletterPositions()
: returns the positions within a string of a given lettermap()
: uses a callback to make a change to an arraytakeUntil()
: uses a callback to determine how much of an array will be returnedwithout()
: removes specified elements of array if they exist within given arrayassertObjectsEqual()
: uses eqObjects to form a statement on equality between two objects