1.0.0 • Published 5 years ago
@mikeackison/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 @mikeackison/lotide
Require it:
const _ = require('@mikeackison/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
- function 1
headreturns the first element in the array, return the first element as an array. - function 2
tailreturns eerything except for the first item (head) of the provided array. - function 3
middlereturn an array with only the middle element(s) of the provided array - function 4
countLettersreturns a count of each of the letters in that sentence. - function 5
countOnlyreturns an object containing counts of everything that the input object listed. - function 6
findKeyreturn the first key for which the callback returns a truthy value. If no key is found, then it should return undefined. - function 7
findKeyByValuescan the object and return the first key which contains the given value. If no key with that given value is found, then it returns undefined. - function 8
letterPositionsreturn all the indices (zero-based positions) in the string where each character is found. - function 9
mapreturns a new array based on the results of the callback function - function 10
takeUntilwill keep collecting items from a provided array until the callback provided returns a truthy value. - function 11
withoutreturns a subset of a given array, removing unwanted elements
1.0.0
5 years ago