1.0.1 • Published 2 years ago
@amuliawijaya23/lotide v1.0.1
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 @amuliawijaya23/lotide
Require it:
const _ = require('@amuliawijaya23/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...)
: assert whether two arrays are equalassertEqual(...)
: assert whether two values are equalassertObjectsEqual(...)
: assert whether two objects are equalcountLetter(...)
: count number of specified letter within a specified stringcountOnly(...)
: count number of specified item in an arrayeqArrays(...)
: check whether two arrays are equaleqObjects(...)
: check whether two objects are equalfindKey(...)
: find the key of an object through callbackfindKeyByValue(...)
: find key of an object given its valueflatten(...)
: return nested arrays into one single arrayhead(...)
: return the value of the first index in the arrayletterPositions(...)
: return an array of index of the specified letter within a sentece/stringmap(...)
: applies a callback function to every value inside an arraymiddle(...)
: return value of the middle index of an arraytail(...)
: remove and return an array without its first indextakeUntil(...)
: iterate through an array and return an array until the specified value within the itterated arraywithout(...)
: filter and array from a specified value