1.0.1 • Published 1 year ago
@cchand-npm/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 @cchand-npm/lotide
Require it:
const _ = require('@cchand-npm/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: prints a positive or negative assertion depending on whether two arrays are equal in type and valueassertEqual(...)
: prints a positive or negative assertion depending on whether the actual output of a function and the expected output are equal in type and valueassertObjectsEqual(...)
: prints a positive or negative assertion depending on whether two objects are equal in type and valuecountLetters(...)
: counts the frequency of each letter in a phrasecountOnly(...)
: counts the frequency of a given element, or group of elementseqArrays(...)
: compares two arrays to determine if they are equal in type and valueeqObjects(...)
: compares two objects to determine if they are equal in type and valuefindKey(...)
: returns the first property in an object that matches a given inputfindKeyByValue(...)
: returns the key of a given valuehead(...)
: returns the first element of an arrayletterPositions(...)
: returns the index of a given letter and its duplicates in a phrasemap(...)
: uses a callback function to manipulate the elements in an arraymiddle(...)
: returns the middle element of an array (if odd) or the middle two elements (if even)tail(...)
: removes the first element of an arraytakeUntil(...)
: uses a callback function to return the elements of an array until an element meets a given conditionwithout(...)
: returns an array with a given set of elements excluded