@arcanecipher/lotide
v1.0.0
Published
This project was created and published by me as part of my learnings at Lighthouse Labs.
Downloads
79
Readme
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 @arcanecipher/lotide
Require it:
const _ = require('@arcanecipher/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: Compares two arrays and returns true if they are equal, false otherwiseassertEqual(...)
: Compares two values and returns true if they are strictly equal, false otherwiseassertObjectsEqual(...)
: Logs a message to the console based on whether two objects are equalcountLetters(...)
: Takes a string and returns an object containing the counts of each letter in the stringcountOnly(...)
: Counts specified items from an array, based on the itemsToCount objecteqArrays(...)
: Compares two arrays for a perfect match (strict equality of elements and order)eqObjects(...)
: Compares two objects to check if they are equalfindKey(...)
: Finds the first key in an object where the callback function returns true for the valuefindKeyByValue(...)
: Finds the first key in an object that matches the specified valueflatten(...)
: Flattens a nested array into a single-level arrayhead(...)
: Returns the first element of an arrayisObject(...)
: Evaluates a value to check if is strictly an object. Will exclude null, Arrays, and Functions as "objects"letterPositions(...)
: Returns an object where each key is a character from the input sentencemap(...)
: Takes an array and a callback function, applies the callback to each item in the array, and returns a new array with the resultsmiddle(...)
: Returns the middle element(s) of an arraytail(...)
: Returns the last element of an arraytakeUntil(...)
: Returns a slice of the array with elements taken from the beginning until the callback function returns a truthy value.without(...)
: Returns a new array that excludes specific unwanted elements from the source array