1.0.1 • Published 4 years ago
@araff-16/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 @araff-16/lotide
Require it:
const _ = require('@araff-16/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
map(array, callback): creates a new list provided an array and a callabck function specifying the manipulationtail(array): returns a new array with all elements of array except for the firsttakeUntil (array,callback): creates a new list using the elements in the provied list until the conditon in the callback function is satifiedwithout (array,itemsToRemove): provide a new list with the items from itemsToRemove removed from arraymiddle (array): Returns the middle element of the arrayletterPositions (string): return an object with letter as keys and values as a list of positons of each letterhead (array): Returns the first element in the arrayflatten (array): takes an arrray with nested arrays an returns a single arrayfindByKeyValue (object,value): returns the object key belonging to the value providedeqObjects (object1,object2): checks the equality of object1 and object2eqArrays (array1,array2): checks the equality of array1 and array2countOnly (allItems,itemsToCount): takes an array of strings allItems and return a count of the items specified in itemsTOCountcountLetters (string): returns a count of all the letter in a string