1.0.0 • Published 2 years ago
@naidu.shraddha/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 @naidu.shraddha/lotide
Require it:
const _ = require('@naidu.shraddha/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual
: if arrays are equal, returns trueassertEqual
: if two values are equal, returns trueassertObjectsEqual
: if two objects are eqaul, returns truecountLetters
: counts letters and individual occurrences in a stringcountOnly
: counts occurences of items within an object with a listeqArrays
: compares two arrayseqObjects
: compares two objectsfindKey
: identifies a key for which the callback returns truefindKeyByValue
: indentifies a key in an object based on a given parameterhead
: returns first element in an arrayletterPositions
: returns with index postions of each character within a stringmap
: creates a new array by transforming each individual element in an excisting array by calling a provided functionmiddle
: returns element that is in the middle of the arraytail
: returns every element within an array except for the head(first)takeUntil
: returns portion of an arraywithout
: removes elements from an array
1.0.0
2 years ago