1.0.0 • Published 1 year ago
@elicolussi/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 @elicolussi/lotide
Require it:
const _ = require('@elicolussi/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(assertArraysEqual)
: checks if two arrays are equalfunction2(assertEqual)
: checks if two values are equalfunction3(assertObjectsEqual)
: checks if two objects are equalfunction4(countLetters)
: returns count of each letter in stringfunction5(countOnly)
: takes input and returns a count of chosen itemsfunction6(eqArrays)
: compares two arrays returns boolfunction7(eqObjects)
: compares two objects returns boolfunction8(findKey)
: searches for a key chosen by the user that returns truthyfunction9(findKeyByValue)
: searches for key in object that matches given valuefunction10(flatten)
: flattens array with nested arrays into a single arrayfunction11(head)
: retrieves the first element of an arrayfunction12(index)
: a list of all the functions stored in an objectfunction13(letterPosition)
: returns indices of letters position in a given stringfunction14(map)
: creates a new array with the results of calling a provided function on every element in the calling arrayfunction15(middle)
: returns middle element(s) of an arrayfunction16(tail)
: returns every element of array except the head (first element)function17(takeUntil)
: returns a slice of an array with elements taken from the beginningfunction18(without)
: removes elements from an array
1.0.0
1 year ago