1.0.1 • Published 6 years ago
@xynyx/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 @xynyx/lotide
Require it:
const _ = require('@xynyx/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(array1, array2): Print whether arrays are equal or notassertEqual(actual, expected): Compares two values to determine equalityassertObjectsEqual(object1, object2): Compare two objects for equalitycountLetter(string): Counting number of letters in string, creating an objectcountOnly(allItems, itemsToCount): Given values (itemsToCount), return number of found items as an integereqArrays(array1, array2): Compare arrays and return true if equaleqArraysRecursion(array1, array2): Compare arrays using recursioneqObjects(object1, object2): Compare objects for equalityeqObjectsRecursion(object1, object2): Compare objects for equality recursivelyfindKey(object, callback): Given a callback key, find and print the key in objectfindKeyByValue(genres, show): Print key given an object (genres) and a value (show)flatten(array): Combine nested arrays into one flat arrayhead(array): Given an array, return the first valueletterPositions(sentence): Return the index of each letter in a sentencemap(array, callback): Given a callback, modify the given arraymiddle(array): Given an array, return the middle valuetail(array): Given an array, return the values after the first valuetakeUntil(array, callback): Given an array, return modified array, stopping at the inputted callback functionwithout(source, cut): Will return an array that removes given cut values