1.0.3 • Published 3 years ago
@campbell46/lotide v1.0.3
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 @campbell46/lotide
Require it:
const _ = require('@campbell46/lotide');
Call it:
const results = _.tail([1, 2, 3]) // ==> [2, 3]
##Documentation
The following functions are currently implemented:
head(...)
: takes in an array and returns the first elementtail(...)
: takes in an array and returns everything except the first elementmiddle(...)
: takes in an array and returns the middle most elementflatten(...)
: takes in an array off arrays and returns a flattened versioncountOnly(...)
: takes in a collection of items and returns specific key, value countscountLetters(...)
: takes in a string and returns a count of each letterfindKey(...)
: takes in an object and a callback and returns the first key that makes the callback truefindKeyByValue(...)
: takes in an object and a value and returns the first key that matches that valueletterPosition(...)
: takes in a string and returns the index's of lettersmap(...)
: takes in an array and a callback and returns a new array based on the callbacktakeUntil(...)
: takes in an array and a callback and returns a slice of the array based on the callbackwithout(...)
: takes in an array and an itemsToRemove array and returns only the elements not found in the itemsToRemove arrayeqArrays(...)
: takes in 2 arrays and returns true if they are equal, false otherwiseeqObjects(...)
; takes in 2 objects and returns true if they are equal, false otherwise