1.0.0 • Published 2 years ago
@meganmcbride/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 @meganmcbride/lotide
Require it:
const _ = require('@meganmcbride/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
_.countLetters(string)
: Takes a string and returns an object of the letters occurance_.countOnly(allItems, itemsToCount)
: Takes in a a collection of items and returns the count for a specific subset of the items_.findKey(...)
: Takes in an object and a callback returning the first key where the callback returns true_.findKeyByValue(object, value)
: Takes in an object and a value returning the first key which contains the given value_.head(array)
: Returns the first item in an array returning the first key where the callback returns true_.letterPositions(string)
: Returns all the indices in a string where each character is found_.map(array, callback)
: Takes in an array to map and a callback function_.middle(array)
: Returns the middle value in an array_.tail(array)
: Returns an array without the first item_.takeUntil(array, callback)
: Takes in an array and a callback_.without(source, itemsToRemove)
: Returns a subset of a given array, removing specified remove items
1.0.0
2 years ago