1.0.0 • Published 3 years ago
@jessemcdermott/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 @jessemcdermott/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head()
: Produces the 0 element in arraymiddle()
: Produce middle elements of an array onlytail()
: Removes first array element and produces the remaining array elementsassertArraysEqual()
: tests a function and produces a passed or failed result for an arrayassertEqual()
: again tests a function and produces a passed or failed resultassertObjectsEqual()
: again tests a function and produces a passed or failed result for an objectcountLetters()
: counts how many times a letter is present in an argumentcountOnly()
: counts how many times a string in presentcountOnly()
: counts how many times a string in presenteqArrays()
: checks to see if 2 arrays matcheqObjects()
: checks to see if 2 objects matchfindKey()
: finds the key in an objectfindKeyByValue()
: finds the key by it's value in an objectletterPositions()
: checks the position/s of a letter in an argumentmap()
: checks to see if the position of a letter matches that passed in an argumenttakeUntil
: callsback an array based on it's argumentwithout()
: will output only the shared elements of two arrays
1.0.0
3 years ago