1.0.0 • Published 5 years ago
dpappolotide 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 @dpappo/lotide
Require it:
const _ = require('@dpappo/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...): console logging a shallow compare of arraysassertEqual(...): console logs a shallow compare of primitivesassertObjectsEqual(...): console logging a shallow compare of objectscountOnly(...): counts items in arrays and objectseqArray(...): shallow compare of arrayseqObject(...): shallow compare of objectsfindKey(...): takes an object and callback, and if true returns the individual itemfindKeyByValue(...): takes an object and value, and returns the value if trueflatten(...): converts multi-dimension array to single dimension arrayhead(...): returns first item in a arrayletterPositions(...): returns the position of letters within a stringmap(...): performs a function to every item of an array and returns new array with outputmiddle(...): outputs the middle character(s) of a stringrecursiveEqArray(...): deep comparison of arraysrecursiveEqObject(...): deep comparison of objectsreverse(...): reverses a stringtail(...): returns array without first elementtakeUntil(...): returns array until value parameter is reachedwithout(...): returns array with elements removed
1.0.0
5 years ago