1.0.0 • Published 6 years ago
@praneethabc/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 @praneethabc/lotide
Require it:
const _ = require('@praneethabc/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...):removes the first element of arraytail(...):removes the last element of arraymiddle(...):returns the middle element of arraryassertArrayEqual(...):test function to check if 2 arrays are equalassertEqual(...): test function to check if 2 given values are equalassertObjectsEqual(...): to check if 2 objects are equalcountLetters(...):counting letters of a given stringcountOnly(...): gives the count of specified items from an objecteqArrays(...): comparing if 2 arrays are equalfindKey(...): finding required key from given objectfindKeyByValue(...):finding the key of a given value of a objectflatten(...): to flatten nested arrays.letterPosition(...): to find the position of a letter in a given stringmap(...): gives an array with first letters of each element of given arraytakeUntill(...): executing a calllabck and getting a new array untill we get the condition is satisfiedwithout(...): removing a given element from the array and returning the result
1.0.0
6 years ago