1.0.0 • Published 3 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
head
returns the first element in the array, return the first element as an array. - function 2
tail
returns eerything except for the first item (head) of the provided array. - function 3
middle
return an array with only the middle element(s) of the provided array - function 4
countLetters
returns a count of each of the letters in that sentence. - function 5
countOnly
returns an object containing counts of everything that the input object listed. - function 6
findKey
return the first key for which the callback returns a truthy value. If no key is found, then it should return undefined. - function 7
findKeyByValue
scan 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
letterPositions
return all the indices (zero-based positions) in the string where each character is found. - function 9
map
returns a new array based on the results of the callback function - function 10
takeUntil
will keep collecting items from a provided array until the callback provided returns a truthy value. - function 11
without
returns a subset of a given array, removing unwanted elements
1.0.0
3 years ago