1.0.0 • Published 2 years ago
@hollyygardner/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 @hollyygardner/lotide
Require it:
const _ = require('@hollyygardner/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(a,b)
: assertion function indicating equality of arraysassertEqual(a,b))
: assertion function with emojis indicating equality of a,bassertObjectsEqual(a,b)
: testing functions indicating equality of objectscountLetters
: looping to find number of character occurancescountOnly(a,b)
: returning count for subset of itemseqArrays(a,b)
: comparing arrays indicating equalityeqObjects(a,b)
: object key iterationfindKey(a,callback)
: returning first key for which callback returns truthy valuefindKeyByValue(a,b)
: scanning objects and returning first keyhead(a)
: returning first element of arrayletterPositions
: returning indices in string where character is foundmap(a,callback)
: returning sub-array of a and including first charactersmiddle(a)
: returning middle element of a as arraytail(a)
: returning new array removing first element of atakeUntil(a,callback)
: returning slice of array until callback returns truthy valuewithout(a,callback)
: returning new array, removing elements of a
1.0.0
2 years ago