1.0.0 • Published 2 years ago
@glavovica/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 @glavovica/lotide
Require it:
const _ = require('@glavovica/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arr1, arr2)
: Verifies if the content in original array and the expected array are the same.assertEqual(actual, expected)
: Verifies if the original value input is the same as the expected outputassertObjectEqual(actual, expected)
: verifies if the content of the object are the samecountOnly(allitems, itemsToCount)
: counts array and returns object of the item counter and the amount of times it is in the array.countLetters(letterCounter)
: counts how many of each letter is in the string returns object with properties and valueseqArrays(arr1, arr2)
: compares both arrays if the contents are identical and returns a booleaneqObjects(obj1, obj2)
: compares both objects if they are identical and returns a booleanfindKey(object, callback)
: descriptionfindKeyByValue(object, value)
: finds the key in the object by the valuehead(arr)
: returns first item in arrayletterPosition(sentence)
: returns the indexes of a letter in a stringmap(array, callback)
: returns new array in regards to the callback funtion it usedmiddle(arr)
: finds the middle items of an arraytail(arr)
: returns body of the array not counting the headtakeUntill(array, callback)
: pushes items in new array untill the condition is metwithout(source, toRemove)
: removes items from the array
1.0.0
2 years ago