1.0.3 • Published 4 years ago
@bduong94/lotide v1.0.3
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 @bduong94/lotide
Link can also be found at: https://www.npmjs.com/package/@bduong94/lotide
Require it:
const _ = require('@bduong94/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: Asserts if two arrays are equalassertEqual
: Asserts if two elements are equalassertObjectsEqual
: Asserts if two objects are equalcountLetters
: Counts the number of times a character appears in a stringcountOnly
: Counts the number of times an element appears in an array from using elements from another arrayeqArrays
: Checks if two arrays are equaleqObjects
: Checks if two objects are equalfindKey
: Function that returns a key based on a callback functionfindKeyByValue
: Function that returns a key if the value is found for that key within the objectflatten
: Function that splits arrays into individual elementshead
: Function returns the first element of an arrayletterPositions
: Function that returns indices of a stringmiddle
: Function that returns the middle element of an arraytail
: Function that returns everything except the first element of an array