1.0.1 • Published 3 years ago
@benjaminmeng/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 @benjaminmeng/lotide
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: returns the first item of an arraytail: returns the every item of an array except for the first onemiddle: returns the middle item of an arraycountLetters: returns the counts of each lettercountOnly: returns the counts for the given wordfindKey: returns the first key of an objectfindKeyByValue: returns the value of a key that matches the given valueflatten: returns a single array for nested arraysletterPositions: returns the indexes of the letters in a stringmap: creates an array with the modification of each element of the callback functiontakeUntil: returns an array that contains all elements from the begining of the original array before the call of the callback functionwithout: removes items from an arrayassertArraysEqual: compare two arrays to see if they are equalassertEqual: compare two values to see if they are equalassertObjectsEqual: compare two objects to see if they are equal