1.0.1 • Published 3 years ago
@nicolamgh/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 @nicolamgh/lotide
Require it:
const _ = require('@nicolamgh/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
eqArrays(array1, array2): compare two arrays to check if they are equal and return true or falseeqObjects(object1, object2): compare two objects to check if they are equal and return true or falsecountLetters(str): take in a sentence and return a count of each of the letters in that sentencecountOnly(allItems, itemsToCount): take in a collection of items and returns a subset of those itemsfindKeyByValue(obj, check): take in an object and a value and return the first key containing the given value if foundflatten(array): take in a nested array and flatten it to a single levelletterPositions(str): return the position of a letterloopyLighthouse(range, multiple, words): print different words based on a specified range and multiplemap(array, callback): return the result of a callback function on a given arraymiddle(array): return the middle element of the given arrayhead(array): return the first element of the given arraytail(array): return all the elements of the given array except the firstpigLatin(str): return a crypted stringtakeUntil(array, callback): return the result of a callback on the array where the original array is sliced until the callback evaluates to truewithout(source, itemsToRemove): return the result with only those elements from the source that are not present in the itemsToRemove array