1.0.0 • Published 2 years ago
@courtneyo/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 @courtneyo/lotide
Require it:
const _ = require('@courtneyo/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actualInput, ExpectedInput)
: asserts equality of two arraysassertEqual(actual, expected)
: asserts if two values are equalassertObjectsEqual(actual, expected)
: asserts if two objects are equalcountLetters(string)
: counts the character in a stringcountOnly(allItems, itemsToCount)
: counts specified items to be counted from a given groupeqArrays(array1, array2)
: tests if two arrays are equaleqObjects(object1, object2)
: checks if two objects are equalfindKey(object, callback)
: finds the first key of object where callback is truthyfindKeyByValue(object, value)
: finds the first key of object where value is truthyflatten(array)
: merges arrays and nested arrays into one arrayhead(inputArray)
: returns only the first item in the arrayletterPositions(sentence)
: return all indeces of sentence where character is foundmap(array, callback)
: creates a new array from calling a function for every array elementmiddle(array)
: finds the middle element(s) of the arraytail(inputArray)
: returns all but the first item in the arraytakeUntil(array, callback)
: returns a slice of the array with elements taken from the beginning.without(arraySource, itemsToRemove)
: returns array with specified items removed
1.0.0
2 years ago