1.0.3 • Published 4 years ago
@s-awaken/lotide v1.0.3
Syrym's Lotide Project
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 @s-awaken/lotide
Require it:
const _ = require('@s-awaken/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(actual, expected)
: asserts equality of 2 arraysassertEqual(actual, expected)
: equality assertionassertObjectsEqual(actual, expected)
: Asserts equality of 2 objectscountLetters(string)
: counts every occurence of each charactercountOnly(allItems, itemsToCount)
: counts each item in the allItems that are present in itemsToCount objecteqArrays(array1, array2)
: checks if 2 arrays are equaleqObjects(object1, object2)
: checks if 2 objects are equalfindKey(object, callback)
: returns only keys satisfied by callback functionfindKeyByValue(objects, value)
: returns keys with the given valueflatten(array)
: flattens a nested arrayhead(array)
: returns first element of an arrayletterPositions(sentence)
: returns positions of each lettermap(array, callback)
: returns a new array with callback returned elements from first arraymiddle(array)
: returns the middle of an arraytail(array)
: returns array without the first elementtakeUntil(array, callback)
: returns array with elements until the callback is no longer satisfiedwithout(array1, array2)
: returns new array with elements of array1, but without elements of the array2