1.0.1 • Published 1 year ago
@lianakan/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 @lianakan/lotide
Require it:
const _ = require('@lianakan/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
countLetters(sentence)
: returns an object which counts the frequency of the occurance of each lettercountOnly(allItems, itemsToCount)
: counts the frequency of itemsToCount in the array allItemseqArray(firstArr, secondArr)
: compares both arrays and returns true/falseeqObjects(object1, object2)
: compares both objects and returns true/falsefindKey(object, callback)
: uses the callback function, loops through array and returns the key if the callback is truefindKeyByValue(obj, val)
: returns the key of val in an object objflatten(array)
: combines nested array into the arrayhead(array)
: returns the first value of an arrayletterPositions(sentence)
: returns an object with the indexes of each letter in sentencemap(array, callback)
: clone of .map()middle(array)
: returns the middle value(s) of an arraytail(array)
: returns an array without its headtakeUntil(array, callback)
: returns the sliced array until callback function is truthywithout(source, itemsToRemove)
: returns array without itemsToRemove