1.0.1 • Published 2 years ago
@mackyclap/lotide v1.0.1
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 @mackyclap/lotide
Require it:
const _ = require('@mackyclap/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: Returns first index value of arraytail(...)
: Returns all index values after first index of arraymiddle(...)
: Returns middle index(s) of arraycountLetters(...)
: Counts the letters in a stringcountOnly(...)
: Count only specific values in an arrayfindKey(...)
: Find the key of an nested object based on the value of the nested propertyfindKeyByValue(...)
: Find the key of an object based on its valueflatten(...)
: Return flattened version of a nested arrayletterPositions(...)
: Return indicies in the string where each character is foundmap(...)
: Return a new array based on the results of a callback function that is iterated over an arraytakeUntil(...)
: Collects items from a provided array until the callback provided returns a truthy value.without(...)
: Compares two arrays and returns an array with values that exist in the first array but not the second array