1.0.0 • Published 2 years ago
@mwoods0157/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 Matthew Woods as part of my learnings at Lighthouse Labs.
Usage
Install it:
npm install @mwoods0157/lotide
Require it:
const matty = require('@mwoods0157/lotide');
Call it:
const results = matty.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: asserts whether 2 arrrays are equal (t/f)assertEqual(...)
: asserts whether 2 primative types are equal (t/f)assertObjectEqual(...)
: asserts whether 2 objects are equal (t/f)countLetters(...)
: counts the number of letters within a string inputcountOnly(...)
: counts the number of times a letter appears within a stringeqArrays(...)
: tests the equality of 2 arrays which are inputseqObject(...)
: tests the equality of 2 objects which are inputsfindKey(...)
: returns the first value of an object given its keyfindKeyByValue(...)
: returns the first key of an object given its valueflatten(...)
: returns array with single level from an input with mutliple array levelshead(...)
: returns the first array element given an arrayindex(...)
: used with mocha/chai for async JS to export object methodsletterPosition(...)
: returns the indices of all letters within an input stringmap(...)
: custom map function for arraysmiddle(...)
: returns the middle value of an input arraytail(...)
: returns the tail array of an input arraytakeUntil(...)
: returns an array of values with the tail section which starts being removed at input valuewithout(...)
: returns an array of values which have had their input value spliced out
1.0.0
2 years ago