1.0.0 • Published 2 years ago
@mattlawson98/lotide v1.0.0
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 @username/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual(...)
: Checks if 2 arrays are equalassertEqual(...)
: Checks if 2 values are equalassertObjectEqual(...)
: Checks to see if 2 objects are equalcountletters(...)
: Gives a count of every letter in a phrasecountOnly(...)
: Gives a count of any elements you choose in an arrayeqArrays(...)
: Compares 2 arrays to see if they are the same, will return true or falseeqObjects(...)
: Compares 2 objects to see if they are the same, will return true or falsefindKey(...)
: Returns the key that matches the input valuefindKeyByValue(...)
: Returns a key that matches the value chosenhead(...)
: returns the first element of an arrayindex(...)
: Has reference to any utility functions within this folderletterPositions(...)
: Returns where a chosen letter sits within a phrasemap(...)
: Goes through an array and returns whatever values you choose for each elementmiddle(...)
: Returns the middle value(s) of an arraytail(...)
: Returns the last value of an arraytakeUntil(...)
: Goes through an array returning its values until reaching a chosen value within the arraywithout(...)
: returns an array with specific element removed from the array while still keeping the original array intact
1.0.0
2 years ago