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 @username/lotide
Require it:
const _ = require('@victorcwyu/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: asserts that two arrays are equalassertEqual
: asserts that two elements are equalassertObjectsEqual
: asserts that two objects are equalcountLetters
: counts the letters in a sentencecountOnly
: counts specific items in a collectioneqArrays
: determines if two arrays are equal, returning true or falseeqObjects
: determines if two objects are equal, returning true or falsefindKey
:takes in an object and a callback. It should scan the object and return the first key for which the callback returns a truthy value.findKeyByValue
: takes in an object and a value. It should scan the object and return the first key which contains the given value.flatten
: flattens a nested array into a single-level arrayhead
: removes the first element from an arrayletterPositions
:map
: creates a new array populated with the results of calling a provided function on every element in the calling arraymiddle
: outputs the middle value(s) of an arraytail
: removes the head of an arraytakeUntil
: will keep collecting items from a provided array until the callback provided returns a truthy value.without
: filters data of unwanted items