1.0.2 • Published 3 years ago
@sowmyavijayendra/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 @sowmyavijayendra/lotide
Require it:
const _ = require('@sowmyavijayendra/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(...): Asserts if two arrays are equalassertEqual(...): Asserts if two values are equalassertObjectsEqual(...): Asserts if two objects are equalcountLetters(...): Counts each letter in a sentencecountOnly(...): Counts each specified word in an arrayeqArrays(...): Returns true if two arrays are equaleqobjects(...): Returns true if two objects are equalfindKey(...): finds first key in an object based on the callback function logicfindKeyByValue(...): finds first key in an object based the specified Valueflatten(...): returns a flattened nested arrayhead(...): returns first element in an arrayletterPositions(...): returns an object with each letter in the given word as key and number of its occurances as the valuemap(...): custom map function which calls callback func on each array elementmiddle(...): finds middle element of an arraytail(...): returns all elements except first element of an arraytakeUntil(...): returns an array with all the elements till the callback function failswithout(...): returns an array with elements not specified in items to remove list