1.0.0 • Published 1 year ago
@ayanaya/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 @ayanaya/lotide
Require it:
const _ = require('@ayanaya/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual()
: Test for asserting if arrays are equal.assertEqual()
: Test for asserting if two primitive values are equal.assertObjectsEqual()
: Asserts if two objects are equal.countLetters()
: Determines number of each letter in a string.countOnly()
: Counts for specific subset of input items.eqArrays()
: Determines if two arrays are equal.eqObjects()
: Determines if two objects are equal.findKey()
: Scans the object and returns the first key for which the callback returns a truthy value.findKeyByValue()
; Scans the object and return the first key which contains the given value.head()
: Retrieves first element of array.letterPositions()
: Returns all the indices (zero-based positions) in a string where each character is found.map()
: Takes in two arguments, an array and callback function and returns a new array based on the results of the callback function.middle()
: Returns middle element(s) of an array.tail()
: Returns all but the 1st element of array.takeUntil()
; Collects items from a provided array until the callback provided returns a truthy value.without()
: Removed element(s) from array based on input.
1.0.0
1 year ago