1.0.0 • Published 2 years ago

@macbar/lotide v1.0.0

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

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 @macbar/lotide

Require it:

const _ = require('@macbar/lotide');

Call it:

const results = _.tail([1, 2, 3]) // => [2, 3]

Documentation

The following functions are currently implemented:

  • function1(head): extracts the first item in the array, and returns it
  • function2(tail): extracts the last item in the array, and returns it
  • function3(middle):extracts the middle item/items in the array, and returns it. Does not return anything if array is size of 0 or 1.
  • function4(assertArrayEqual): matches the data of two arrays and returns if they are equal or not.
  • function5(assertEqual): matches two arguments and returns if they are equal or not.
  • function6(eqArrays): matches arrray size and returns if they are equal.