1.0.0 • Published 2 years ago
@baedoh/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 @baedoh/lotide
Require it:
const _ = require('@baedoh/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertAraysEqual
: compares non-primitive arraysassertEqual
: tests code to see if it's a pass or failassertObjectsEqual
: compares objects (with emoji visuals)countLetters
: takes in a sentence (as a string) and returns a count of each letter in said sentencecountOnly
: takes in a collection of items and returns counts for a specific subset of said itemseqArrays
: compares arrays (primitive)eqObjects
: compares objectsfindKey
: takes in an object and callback and returns the first key for which the callback returns a truthy valuefindKeyByValue
: finds key on an object where its value matches a given valuehead
: retrieves the first item of an arrayletterPositions
: returns all indices in the string where each letter is foundmap
: returns a new array based on results of the callback functionmiddle
: returns the middle value of an array with an odd number of indices, and the two middle values of an array with an even number of indicestail
: retrieves every element in an array except the headtakeUntil
: returns a slice of an array with elements taken from the beginningwithout
: removes unwanted items from data
1.0.0
2 years ago