1.0.0 • Published 3 years ago
@kb09/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 kb09/lotide
Require it:
const _ = require('kb09/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: returns the first element of an arrayfunction2(tail)
: returns every element except the first element of an arrayfunction3(middle)
: returns the middle element of an arrayfunction4(assertArraysEqual)
: asserts if two arrays are equalsfunction5(assertEqual)
: asserts if two values are equalsfunction6(eqArrays)
: compares two arraysfunction7(assertObjectsEqual)
: asserts if two objects are equalsfunction8(countLetters)
: returns counts of each letter of a stringfunction9(countOnly)
: takes items and returns counts for a subset of those itemsfunction10(eqObjects)
: compares two objectsfunction11(findKey)
: scans object and returns the first key for which the callback is truthyfunction12(findKeyByValue)
: searches a key on an object where its value matches the value givenfunction13(flatten)
: returns a single array from an array of arraysfunction14(letterPositions)
: returns the indices in the string where each character is foundfunction15(map)
: creates a new array from calling a given function on every element in the calling arrayfunction16(takeUntil)
: returns data from an array until callback functions is falsefunction17(without)
: removes specific elements from an array
1.0.0
3 years ago