1.0.1 • Published 6 years ago
@begeh/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 @begeh/lotide
Require it:
const _ = require('@begeh/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
eqArrays(...): compares two arrays for equivalencyeqObjects(...): compares two objects for equivalencyassertArraysEqual(...): checks if two arrays are equal and returns pass/fail messageassertEqual(...): checks if two variables are equal and returns pass/fail messageassertObjectsEqual(...): checks if two objects are equal and returns pass/fail messagecountLetter(...): searches for a letter(s) and finds the number of times it/they occur in a stringcountOnly(...): counts the number of times an item appears in an object listfindKey(...): checks which keys in an object meet the criteria of a passed functionfindKeysByValue(...): finds a key based on its valueflatten(...): flattens an arrayletterPositions(...): finds the index/indices of a letter in a stringmap(...): maps over an array basedtakeUntil(...): returns an array of items from another array up until an item is reached that meets the criteria of a passed functionwithout(...): returns a copy of an array with the indicated values removed from the arrayhead(...): returns the first element (the head) from an arraymiddle(...): returns the middle element from an arraytail(...): returns a copy of an array that includes all elements except its first elements