1.0.0 • Published 5 years ago
@jackylau/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 @jackylau/lotide
Require it:
const _ = require('@jackylau/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: To compare multiple expressions of arraysassertEqual(...)
: To compare multiple expressions or things; usually stringsassertObjectsEqual(...)
: To compare multiple expressions in the form of objectscountLetters(...)
: To count how many letters that are repeated in a given inputcountOnly(...)
: To count the only the input value and also return how many times the specify values are repeatedeqArrays(...)
: To compare if multiple arrays are the same including their specific elements withineqObjects(...)
: To compare if multiple objects inputted are the same by matching the same values withinfindKey(...)
: To find the key of an objectfindKeyByValue(...)
: To find the key of an object by using its' dedicated valueflatten(...)
: To remove an array of an array and return the specified value or inputhead(...)
: To return the first element of a string or an arrayletterPositions(...)
: To return the position or positions of the inputted characters/words/phrases in a stringmap(...)
: To make a new array from a function that calls for every element in a arraymiddle(...)
: To return the middle element of an array; if array is odd, return a single element; if even, return an array with 2; if single element array return []tail(...)
: To return a new array with the specify element including the ones after from an arraytakeUntil(...)
: To return a new array with the specify rangewithout(...)
: To remove an array from another array
1.0.0
5 years ago