1.0.0 • Published 4 years ago
@mvocruz/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 @username/lotide
Require it:
const _ = require('@mvocruz/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: it returns the first element of an array.tail(...)
: it returns all the elements of an array, except the head(first element).middle(...)
: it return the middle element(s) of an array.countLetters(...)
: it counts the quantity of letters in a string.countOnly(...)
: it counts selected elements in a array.findKey(...)
: it returns the first key for which the callback returns a truthy value.findKeyByValue(...)
: it returns a key for a given object.letterPositions(...)
: it returns all the indeces of a given string.map(...)
: it returns a new array based on the results of the callback function.takeUntil(...)
: it returns a slice of the array with elements taken from the beginning.without(...)
: it removes selected objects from an array.
1.0.0
4 years ago