1.0.0 • Published 1 year ago
@willsmores/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 @willsmores/lotide
Require it:
const _ = require('@willsmores/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: asserts that two arrays are equal, returns true if equal and false if notassertEqual(...)
: asserts that two objects are equal, returns true if equal and false if notassertObjectsEqual(...)
: asserts that two variables are equal, returns true if equal and false if notcountLetters(...)
: counts each character in a stringcountOnly(...)
: counts specific string elements in an arrayeqArrays(...)
: compares two arrayseqObjects(...)
: compares two objectsfindKey(...)
: return the first object key for which the callback returns a truthy valuefindKeyByValue(...)
: search for a key on an object where its value matches a given valuehead(...)
: returns the first element in an arrayletterPositions(...)
: returns the index of a specific character in a stringmap(...)
: returns a new array based on the results of the callback functionmiddle(...)
: returns the middle element in an arraytail(...)
: returns all elements in an array except the firsttakeUntil(...)
: returns slice of array up until a given elementwithout(...)
: removes unwanted elements from array
1.0.0
1 year ago