1.0.0 • Published 2 years ago
@saminthecloud/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 @saminthecloud/lotide
Require it:
const _ = require('@saminthecloud/lotide');
Call it:
const results = _.head([1, 2, 3]) // => 1
Documentation
The following functions are currently implemented:
assertArraysEqual
: asserts if two arrays are equalassertEqual
: asserts if two values are equalassertObjectsEqual
: asserts if two objects are equalcountOnly
: counts the number of instances of a specified list in an arrayseqArrays
: compares two arrays to check if they are equaleqObjects
: compares two objects to check if they are equalfindKey
: finds the first key in an object that satisfies the the callback functionfindKeyByValue
: finds the first key in an object that corresponds to the value of a key value pairhead
: returns the first element in an arraymap
: maps each item of an input array to an output array based on a callback functionmiddle
: returns the middle element of the arraytakeUntil
: returns the elements of an array until the callback function criteria is satisfiedwithout
: removes items from an input array from an array of items to remove
1.0.0
2 years ago