1.0.2 • Published 5 years ago
@vtranduc/lotide v1.0.2
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 @vtranduc/lotide
Require it:
const _ = require('@username/lotide/index');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: This gets the first value of arraytail(array)
: This returns the array except the first value.middle(array)
: Gets middle valassertArraysEqual(array1, array2)
: assert Arrays are equalassertEqual(value1, value2)
: assert that values are equalassertObjectsEqual(object1, object2)
: asserts objects are equalcountLetters(someString)
: count letterscountOnly(someString)
: only count letterseqArrays(array1, array2)
: checks if arrays are equaleqObjects(object1, object2)
: checks if obejcts are equalfindKey(array)
: find the keyfindKeyByValue(array)
: find the key by valueflatten(array)
: flattens outletterPositions(someString)
: letter's positionmap(array)
: mapping of each element in arraytakeUntil(array)
: takes until some condition is metwithout(array)
: without some stuff