1.0.0 • Published 4 years ago
@ahmedabdallh/lotide v1.0.0
Lotide
A mini clone of the Lodash library. Created as a part of bootcamp work.
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 @ahmedabdallh/lotide
Require it:
const _ = require('@ahmedabdallh/lotide');
Call it:
const results = _.head([1, 2, 3]) // => 1
Documentation
The following functions are currently implemented:
head: retruns the first element in an arraymiddle: retruns the middle element in an arraymap: implement a callback function provided as an argument over each element in the given arrayassertEqual: fancier assert function than the builtin assertassertArraysEqual: customize version of assertEqual function to work with arrayscountOnly: returns a count for specific item in the given inputeqArrays: checks if two arrays are equaleqObjects: checks if two objects are equalfindKey: returns the first element it founds with the provided keyfindKeyByValue: returns the first element it founds with the provided valuewithout: returns an array without the specific elements that has been set to be removedtakeUntil: Creates a portion of array with elements taken from the beginning.- this libarary has been tested with "chai": "^4.3.4", "mocha": "^9.1.3"
1.0.0
4 years ago