1.0.0 • Published 8 months ago
@jyhao/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 @jyhao/lotide
Require it:
const _ = require('@jyhao/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: Returns element at index 0tail(array)
: Returns a new array with element at index 0 removedmiddle(array)
: Returns elements from the middle of a given arraycountLetters(string)
: Returns an object that counts the number of letters for each letter.countOnly(array, object)
: Returns an object which counts how many times a given value appearsfindKey(object, callback)
: Returns an object which looks through an object given a functionfindKeyByValue(object, value)
: Returns a key which matches the value givenletterPositions(string)
: Returns an object which contains the position of each lettermap(array, callback)
: Returns a new array given a functiontakeUntil(array, callback)
: Loops through an array given a function to stop, then returns itwithout(array1, array2)
: Removes all values in array2 from array1 then returns it
1.0.0
8 months ago