1.0.0 • Published 4 years ago
@samamoo/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 @samamoo/lotide
Require it:
const _ = require('@samamoo/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArrayEqual
: Provides assertion if two arrays are equal.assertEqual
: Provides assertion if two values are equal.assertObjectsEqual
: Provides assertion if two objects are equal.head
: Returns the value in the first index of an array.middle
: Returns the middle-most value of an array.tail
: Returns the tail end of an array.countLetters
: Counts the number of letters in a string.countOnly
: Counts only what is specified from an object.eqArrays
: Compares the values of two arrays.eqObjects
: Compares the values of two objects.findKey
: Find the object key with a specified value and callback function.findKeyByValue
: Find the object key with a specified value.flatten
: Condenses an array of arrays into a single array.letterPosition
: Find the index position of a specified letter in a string.map
: Map function for arrays.takeUntil
: Return a part of an array that is stopped by a specified condition.
1.0.0
4 years ago