1.0.1 • Published 3 years ago
@nathan-ts/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 library clone was written by me for the purpose of learning JS concepts during Lighthouse Labs' bootcamp.
Usage
Install it:
npm install @nathan-ts/lotide
Require it:
const _ = require('@nathan-ts/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: function that asserts if two arrays are equalsassertEqual(...)
: function that asserts if two values are equalsassertObjectsEqual(...)
: function that asserts if two objects are equalscountLetters(...)
: function that returns counts of each letter of a stringcountOnly(...)
: function that returns an object with a list of counts for a provided object with elements to count, searching a provided arrayeqArrays(...)
: function that compares two arrays for strict equalityeqObjects(...)
: function that compares two objects for strict equalityfindKey(...)
: function that returns the first key of an object for which the callback provided returns a truthy valuefindKeyByValue(...)
: function that returns the key of an object, given that the value matches the provided valueflatten(...)
: function that returns a single-level array, given a 2D arrayhead(...)
: function that retrieves the first element from an arrayletterPositions(...)
: function that returns all the indices in the string where each character is foundmap(...)
: function that creates a new array with the results of calling a provided function on every element in the arraymiddle(...)
: function that returns the middle element(s) of an arraytail(...)
: function that retrieves every element in an array, except the first elementtakeUntil(...)
: function that returns elements in an array up until a given valuewithout(...)
: function that removes elements from an array