@kylemcparland/lotide
v1.0.2
Published
A library published for learning purposes.
Downloads
1
Readme
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 @kylemcparland/lotide
Require it:
const _ = require('@kylemcparland/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual([1, 2, 3], [1, 2, 3])
: Console.logs if arrays are strictly equalassertEqual()
: Console.logs if values are strictly equalassertObjectsEqual()
: Console.logs if objects are strictly equalcountLetters()
: Returns # of times a letter appears in a stringcountOnly()
: Returns # of times a string appears in an arrayeqArrays()
: Returns true if arrays are identical. Otherwise, falseeqObjects()
: Returns true if objects are identical. Otherwise falsefindKey()
: Returns first key with a value that passes a callback function's checkfindKeyByValue()
: Returns key matching a defined valueflatten()
: Returns a single array from a defined series of nested arraysletterPositions()
: Returns an object with arrays of every index each letter appeared at in a defined stringtakeUntil()
: Returns array that includes every value of original array until callback function is triggeredwithout()
: Returns array that excludes defined valueshead()
: Returns array with only the first value of a defined arraytail()
: Returns array with every value excluding the firstmiddle()
: Returns array with the center value(s) of a defined array