1.0.0 • Published 3 years ago
@lilyhabbs/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 @lilyhabbs/lotide
Require it:
const _ = require('@lilyhabbs/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: Returns the first element in an arraytail(array)
: Returns all elements in an array, except for the first elementmiddle(array)
: Returns the middle element of an arrayflatten(array)
: Flattens a nested array into a single-level arraycountOnly(allItems, itemsToCount)
: Counts elements of an array based on specified valuescountLetters(string)
: Returns a count of each letter in a stringletterPositions(string)
: Returns all the indices in a string where each character is foundfindKeyByValue(object, value)
: Returns the first key of an object containing a given valuewithout()
: Filters data from an array by removing unwanted itemsmap(array, callback)
: Executes a function on every element of an arraytakeUntil(array, callback)
: Returns the elements of an array until the condition of the callback function is met
1.0.0
3 years ago