1.0.0 • Published 4 years ago
@mariakhandaker/lotide2 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 @mariakhandaker/lotide2
Require it:
const _ = require('@mariakhandaker/lotide2');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual(...)
: asserts that two values are equalassertArraysEqual(...)
: asserts that two arrays are equalassertObjectsEqual(...)
: asserts that two objects are equalcountLetters(...)
: counts how many instances of each letter occur in a stringcountOnly(...)
: counts only instances of what you request it toeqArrays(...)
: checks if two arrays are equaleqObjects(...)
: checks if two objects are equalfindKey(...)
: find key in an object by looping through keysfindKeyByValue(...)
: find key in object by looping through values and returning key if value is foundhead(...)
: find first element of arrayletterPositions(...)
: finds indexes of each lettermap(...)
: applies a function onto an arraymiddle(...)
: find middle element(s) of an arraytail(...)
: find last element of an arraytakeUntil(...)
: takes elements from array until callbackwithout(...)
: takes elements from array except for the ones specified
1.0.0
4 years ago