1.0.0 • Published 7 months ago
@patty0919/lotide v1.0.0
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 Patty467/lotide
Require it:
const _ = require('Patty467/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEual(...)
: Asserts if two arrays are equalassertEqual(...)
: Tests to see if the assertions are correct or notassertObjectsEqual(...)
: Takes in 2 objects and returns true if they are equal and false otherwisecountLetters(...)
: Takes in a sentence and returns a count of each of the letters in the sentencecountOnly(...)
: Takes in a collection of items and returns a specific subset of those itemseqArrays(...)
: Returns true if the 2 input arrays are equal, and otherwise falseeqObjects(...)
: Takes in 2 objects and returns true if they are equal, false otherwisefindKey(...)
: Takes in an object and callback and returns the first key that meets the criteria specificed in the callbackfindKeyByValue(...)
: Takes in an object and a value and returns the first key that corresponds to that valueflatten(...)
: Takes in an array that contains elments, including nested arrays of elements, and returns a flattened version of the array.head(...)
: Retrives the first element of an arrayletterPositions(...)
: Takes in a string and returns all indices of letter positions in the stringmap(...)
: Takes in an array and a callback and returns a new array based on the results of the callback on each item in the arraymiddle(...)
: Takes in an array and returns the middle most element of the arraytail(...)
: Returns the tail of an arraytakeUntil(...)
: Takes in an array and callback and returns a slice of the array based on the criteria specificed in the callbackwithout(...)
: Takes in a source array, and an itemsToRemove array, and returns only the itmes from the source array that are not in the itemsToRemove array
1.0.0
7 months ago