1.0.0 • Published 1 year ago
@karen-mui/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 @karen-mui/lotide
Require it:
const _ = require('@karen-mui/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected)
: asserts if two arrays are equalassertEqual(actual, expected)
: asserts if two values are equalassertObjectsEqual(actual, expected)
: asserts if two objects are equalcountLetters()
: counts the number of letters in a stringcountOnly
: counts and returns the occurence of a specific subset of items within an objecteqArrays
: compares the equality of two arrayseqObjects
: compares the equality of two arraysfindKey
: searches an object and returns the first key which the callback returns truthyfindKeyByValue
: searches an object for a value and returns the matching keyhead
: returns the first element of an arrayletterPositions
: returns the indices of each character in the stringmap
: returns a new array with the results of applying a callback function on the original arraymiddle
: returns the middle element of an arraytail
: returns an array with every element but the firsttakeUntil
: returns an array populated with elements up until the callback returns truthywithout
: removes elements from an array
1.0.0
1 year ago