1.0.1 • Published 6 months ago
@lmleao/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 @lmleao/lotide
Require it:
const _ = require('@lmleao/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: Assertion function for ArraysassertEqual
: Assertion function (not applicable to Arrays or Objects)assertObjectsEqual
: Assertion function for ObjectscountLetters
: Returns an Object with a count of each letter occurrencecountOnly
: Returns an Object with a count of only the elements that were passed as an argumenteqArrays
: Checks if Arrays are equaleqObjects
: Checks if Objects are equalfindKey
: Finds Key which corresponds to the callback function provided as an argumentfindKeyByValue
: Finds Key which has a value corresponding to the value provided as an argumentflatten
: Flattens a nested Array into a single-level Arrayhead
: Returns the head element of an ArrayletterPositions
: Finds the index position of letters in a sentencemap
: Creates a new Array using the callback function provided as an argumentmiddle
: Finds the middle element of an Arraytail
: Finds the tail elements of an ArraytakeUntil
: Creates a new Array by iterating over items until the condition provided as a callback function returns truewithout
: Creates a new Array without the items specified as an argument