1.0.0 • Published 2 years ago

@ahmedabdallh/lotide v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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 array
  • middle: retruns the middle element in an array
  • map: implement a callback function provided as an argument over each element in the given array
  • assertEqual: fancier assert function than the builtin assert
  • assertArraysEqual: customize version of assertEqual function to work with arrays
  • countOnly: returns a count for specific item in the given input
  • eqArrays: checks if two arrays are equal
  • eqObjects: checks if two objects are equal
  • findKey: returns the first element it founds with the provided key
  • findKeyByValue: returns the first element it founds with the provided value
  • without: returns an array without the specific elements that has been set to be removed
  • takeUntil: 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"