1.0.4 • Published 5 years ago
@mighthire/lotide v1.0.4
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 @mighthire/lotide
Require it:
const _ = require('@mighthire/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array): returns index 0 of an arraytail(array): returns index 0 of a length 1 array or splice(1) of a larger arraymiddle(array): returns a snarky string if array length is 2 or less, or returns the middle 1/2 indexes values.flatten(array): returns a one-level nested array to one single arraycountOnly(array, object: returns a count of items that are true in object from arrayletterPositions(sentence): returns an object of arrays of letter posistions in the input sentencefindKeyByValue(object, string): return key of object.!key! = stringeqObjects(object1, object2): recursive compare objectseqArrays(array1, array2): recursive compare arrays