1.0.0 • Published 1 year ago
@bavyn/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 @bavyn/lotide
Require it:
const _ = require('@bavyn/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: assert if two arrays are equalassertEqual
: assert if two values are equalassertObjectsEqual
: assert if two objects are equalcountLetters
: returns a count of each letter in a stringcountOnly
: takes in a collection of items and returns counts for a specific subset of those itemseqArrays
: compares two arrayseqObjects
: compares two objectsfindKey
: scans an object and returns the first key for which the callback function returns a truthy valuefindKeyByValue
: searches for a key on an object where its value matches a given valuehead
: retrieves the first element of an arrayletterPositions
: returns all indices in a string where each character is foundmap
: creates a new array with the results of calling a provided function on every element in the calling arraymiddle
: returns the middle element of an arraytail
: retrieves all elements aside from the head of an arraytakeUntil
: returns a slice of an array with elements taken from the beginningwithout
: removes elements from an array
1.0.0
1 year ago