@andyku25/lotide
v1.0.1
Published
lotide is a clone of the Lodash library and is used for learning purposes as part of the Lighthouse Labs Bootcamp
Downloads
5
Readme
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 @andyku25/lotide
Require it:
const _ = require('@andyku25/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(arr)
: returns first element of an arraytail(arr)
: returns all elements following the frst element in an arraymiddle(array)
: returns the middle/middle 2 elements in an arraycountLetters(str)
: returns a key-value pair of each letter in the param and the count value of that keycountOnly(arr, obj)
: returns a key-value pair of each object key to search in the arr param and the count value of that obj keyfindKey(obj, cb)
: returns the key of the object param given the cb conditionfindKeyByValue(obj, str)
: returns the key of the object param given a specific valueletterPositions(str)
: returns the key-value pair of each index position of each input valuemap(arr, cb)
: returns a modified array based off of the cb conditionalstakeUntil(arr, cb)
: returns an array of up until a conditional returns a false statementwithout(arr, itemToRemoveArr)
: returns the arr less the 2nd param of items to remove