1.0.1 • Published 3 years ago
@nafaay/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 @nafaay/lotide
Require it:
const _ = require('@nafaay/lotide');
Documentation
The following functions are currently implemented:
head(array)
: takes an array and returns the first alement of this arraytail(array)
: takes an array and return it withou its first elementmiddle(array)
: takes an array and return the array that is in the middlecountLetters(string)
: counts nbre of letters in a given stringcountOnly(items, oneItem)
: loops thru an object and search for a particular itemfindKey(object, callback)
: loops thru an object and search for a particular key using a callback functionflatten(array)
: given an array that may contains other(s) array(s) it returns an array that does not contain any arraytakeUntil(array)
: loops thru an array until finding the first thru condition given by a callback functionwithout(array1, array2)
: given 2 arrays will remove the second array from the first one if the first one ' contains the second one