1.0.0 • Published 2 years ago
@b1u3too/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 @b1u3too/lotide
Require it:
const _ = require('@b1u3too/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: archived for review, do not use - visual console logger of assertions about arraysassertEqual
: archived for review, do not use - visual console logger of assertions about primitive datatypesassertObjectsEqual
: archived for review, do not use - visual console logger of assertions about objectscountLetters
: return object containing summary of how often each letter in a provided string appearscountOnly
: return object summarizing how often specified keys appear in provided objecteqArrays
: check that two provided arrays are strictly equivalent -- recursive handling of nested arrayseqObjects
: check that two provided objects are strictly equivalent -- recursive handling of nested objectsfindKey
: return key of the first value in provided object to pass provided callback function testfindKeyByValue
: return key of the last value matching provided valueflatten
: return 1D array version of provided array containing arrayshead
: return the first element of a provided arrayletterPositions
: return an object reporting on letters used and all index positions they appear in for a given input stringmap
: array.prototype.map weak clone -- apply callback function to each element of a given array, returning a new arraymiddle
: return the middle element(s) of a provided arraytakeUntil
: return a slice of an array from the beginning, until the first element that passes provided callback testtail
: return all but the first element of a provided arraywithout
: take in a source array, and an array listing what not to pass through, and return a new array without those elements!
1.0.0
2 years ago