1.0.3 • Published 8 months ago
@kazvee/lotide v1.0.3
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 @kazvee/lotide
Require it:
const _ = require('@kazvee/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(array1, array2)
: Asserts if two arrays are equalassertEqual(actual, expected)
: Asserts if two values are equalassertObjectsEqual(object1, object2)
: Asserts if two objects are equalcountLetters(string)
: Returns the count of each character (excluding spaces) in a stringcountOnly(allItems, itemsToCount)
: Returns the count of specified items in an arrayeqArrays(array1, array2)
: Returns true if two arrays are equaleqObjects(object1, object2)
: Returns true if two arrays are equalfindKey(object, callback)
: Returns the first key that matches the callback valuefindKeyByValue(object, value)
: Returns the first key that contains the specified valueflatten(arrayWithNestedArrays)
: Returns a single-level array when given an array with nested arrayshead(array)
: Returns the first element of an arrayletterPositions(string)
: Returns the index of each letter in a stringmap(array, callback)
: Returns a new array with the results of applying the callback function to the initial arraymiddle(array)
: Returns the middle elements(s) of an arraytail(array)
: Returns all elements of the array that come after the first elementtakeUntil(array, callback)
: Returns all the elements of an array up until (and not including) the callback valuewithout(source, itemsToRemove)
: Returns a new array with the specified elements removed from the initial array
1.0.3
8 months ago