1.0.1 • Published 3 years ago
@bbayley/lotide v1.0.1
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 @bbayley/lotide
Require it:
const _ = require('@bbayley/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: get the first element of arrayfunction2(tail)
: get all but the first element of arrayfunction3(middle)
: get middle-most element(s) of arrayfunction4(countLetters)
: get count of each letter in a stringfunction5(countOnly)
: get count for a subset of items in an arrayfunction6(eqArrays)
: takes two arrays and returns a boolean based on perfect matchfunction7(eqObjects)
: takes two objects and returns a boolean based on perfect matchfunction8(findKey)
: takes object and callback and return first key that returns truthy valuefunction9(letterPositions)
: Return all indices in a string where characters are foundfunction10(map)
: takes in a array and map and return a new array based on callback resultsfunction11(takeUntil)
: takes in an array and callback and collects items from the array until callback returns truthyfunction12(without)
: will return subset of a given array, removing unwanted elements