1.0.1 • Published 4 years ago
@vvei/lotide v1.0.1
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 @vvei/lotide
Require it:
const _ = require('@vvei/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: return the first element in the arraymiddle(array)
:return the middle element of the array if the array is odd, and return the two middle elements if the array is eventail(array)
: return the last element in the arrayeqArrays(array1, array2)
: return true if the two passed arrays are equal; otherwise, return falseeqObjects(object1, object2)
: return true if the two passed objects are equal; otherwise, return falsecountOnly(array,object)
: return an object contains the name and the number of ocurrences in the array, depends on the object passed in indicated if count the name or notflatten(array)
: return an one-level array of the passed nested array