1.0.0 • Published 3 years ago
@michael_huy/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 @michael_huy/lotide
Require it:
const _ = require('@michael_huy/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected)
: assert arrays equalassertEqual(actual, expected)
: assert equalassertObjectsEqual(actual, expected)
: assert objects equalcountLetters(letters)
: count letterscountOnly(allItems, itemsToCount)
: count only specific lettereqArrays(array1, array2)
: equal arrayseqObjects(object1, object2)
: equal objectsfindKey(objects, callback)
: find specific itemfindKeyByValue(selections, show)
: find specific item by its valueflatten(arr)
: flatten arrayhead(actual)
: take the head of arrayletterPositions(sentence)
: find the position of lettersmap(array, callback)
: mapping arraymiddle(array)
: take the middle part of arraytail(array)
: take the tail of arraytakeUntil(array, callback)
: take items from arraywithout(item, itemRemoved)
: remove item from array Instruction
1.0.0
3 years ago