1.0.0 • Published 3 years ago
@keeganpearson/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 @keeganpearson/lotide
Require it:
const _ = require('@keeganpearson/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head: returns first element in arraytail: returns last element in arraymiddle: returns middle or averaged middleassertArraysEqual: checks if arrays are equalassertEqual: checks if things are equalassertObjectsEqual: checks if objects equalcountLetters: counts number of letters in stringcountOnly: counts only what we wanteqArrays: checks arrays are equal or returns falseeqObjects: checks objects are equalfindKey: returns first true key in objectfindKeyByValue: returns first key in object that matches valueflatten: concatates nested arrays into one arrayletterPositions: returns index position of each letter (exludes spaces)map: returns new array with each original element transformed by the callback functiontakeUntil: returns new array until first truthy value, then stopswithout: returns new array, containing all elements from source that are not in itemsToRemove array
1.0.0
3 years ago