1.0.0 • Published 3 years ago
@rkrowchuk/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 @rkrowchuk/lotide
Require it:
const _ = require('@rkrowchuk/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: checks outcome of eqArraysassertEqual
: checks if two elements are equalassertObjectsEqual
: checks outcome of eqObjectscountLetters
: counts number of times letter appears in a stringcountOnly
: counts number of times select strings appear in an objecteqArrays
: checks if two arrays are equaleqObjects
: checks if two objects are equalfindKey
: finds a key based on an outcome of a callbackfindKeyByValue
: finds a key based on a valuehead
: returns first index of an arrayindex
: exports all lotide functionsletterPositions
: returns the indexes a letter appears inmap
: returns a new array based on the results of a callbackmiddle
: returns the middle element in an arraytail
: returns all but first element in an arraytakeUntil
: returns all elements in an array until the callback is truewithout
: returns an array with all unwanted elements removed
1.0.0
3 years ago