1.0.0 • Published 4 years ago
@p-a-c/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 learning at Lighthouse Labs.
Usage
Install it:
npm install @p-a-c/lotide
Require it:
const _ = require('@p-a-c/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head
: a handy array head-of-array retrievertail
: a handy tail-of-array retrievermiddle
: a handy middle-of-array retrievereqArrays
: determines whether two arrays are equalassertEqual
: determines where the two arguments are equalassertArraysEqual
: a function to compare arrays and log to the console whether or not they are equalcountLetters
: a function that counts only specified items in an arrayfindKey
: finds object keys based on a property argumentmap
: Takes an array and a callback function a returns new array based on callbacktakeUntil
: a function that will return an array including items from the start of the given array up until the ending condition is metwithout
: A function for returning a new array with items removedflatten
: Takes nested arrays and makes one single arraycountOnly
: A function that counts only specified items in an arrayletterPositions
: A handy function that will tell you all the positions of all of the characters in a stringfindKeyByValue
: A handy function for finding the key of a value in an objecteqObjects
: A function to testing if objects are equal. Able to test if object include arrays, but currently can't test if objects include objectsassertObjectsEqual
: A function that will let you know if your objects are equal or not
1.0.0
4 years ago