1.0.0 • Published 5 years ago
@mwong01/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 @mwong01/lotide
Require it:
const _ = require('@mwong01/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: returns true if arrays are equalassertEqual
: returns true if primitive objects are equalassertObjectsEqual
: returns true if objects are equalcountLetters
: given a string of letters, returns cooresponding number of occurancescountOnly
: given an object with list of items, returns cooresponding number of occuranceseqArrays
: determine if two arrays are the sameeqObjects
: determine if two objects are the samefindKey
: identifies the key given an object and callback functionfindKeyByValue
: given an object and callback function, identifies key nameflatten
: merge arrays of arrays into one arrayhead
: returns first item in an arrayletterPositions
: identifies position of letter within a sentencemap
: takes array and callback that will return the modified array with callback function appliedmiddle
: returns middle element(s) of an arraytail
: returns new array with the first index element removed from original arraytakeUntil
: takes array and callback that will retrun all elements that match until the one that does not matchwithout
: takes an array and value of an array, which returns a new array with those array elements removed
1.0.0
5 years ago