1.0.0 • Published 4 years ago
@mrklep90/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 @mrklep90/lotide
Require it:
const _ = require('@mrklep90/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: returns the first item in an arraymiddle(...)
: returns the middle item, or items, in an arraytail(...)
: returns every item in an array after the firstcountLetters(...)
: returns, as an array, each letter in a given string and how many times each letter ocurredcountOnly(...)
: returns an object that contains how many items were counted in a provided array based on a provided criteriafindKey(...)
: returns the key in an object that is associated with a given value (formatted as a callback)findKeyByValue(...)
: eturns the key in an object that is associated with a given valueletterPositions(...)
: returns, as an object, the unique letters in a given string and what index positions they are located atmap(...)
: returns an array populated with the results of calling a given function on each item in the arraytakeUntil(...)
: returns an array populated with the values of a given array up until a given stopping pointwithout(...)
: returns an array populated with the remaining values of a given array after specified items are removed
1.0.0
4 years ago