1.0.0 • Published 3 years ago
@ethanw03/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 @ethanw03/lotide
Require it:
const _ = require('@ethanw03/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEquals(arr1, arr2): console logs whether two arrays are equalassertEqual(actual, expected): console logs whether two inputs are equalassertObjectEqual(actual, expected): console logs whether two objects are equalcountLetters(sentence): counts the total amount of letters in a sentence and console logs the amount of the letter most usedcountOnly(allItems, itemsToCount): counts the amount of times the item appears in the object.eqArrays(arr1, arr2): checks to see if two arrays are equaleqObjects(object1, object2): checks to see if two objects are equal.findKey(object, callback): returns the key of the value outputted from the callback functionkeyByValue(object, value): returns the corresponding key from the value.head(arr): returns the first element of a given arrayletterPositions(sentence): returns the index position(s) of a letter within a stringmap(array, callback): returns the letter at a certain index for each word in a stringmiddle(array): returns the middle index(s) of an arraytail(arr): returns the array without it's first valuetakeUntil(array, callback): returns the array up until the condition of the callback function is satisfiedwithout(source, itemsToRemove): removes an item from the array and returns the array without the given item
1.0.0
3 years ago