1.0.1 • Published 3 years ago

@nafaay/lotide v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 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 @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 array
  • tail(array) : takes an array and return it withou its first element
  • middle(array): takes an array and return the array that is in the middle
  • countLetters(string) : counts nbre of letters in a given string
  • countOnly(items, oneItem) : loops thru an object and search for a particular item
  • findKey(object, callback) : loops thru an object and search for a particular key using a callback function
  • flatten(array) : given an array that may contains other(s) array(s) it returns an array that does not contain any array
  • takeUntil(array) : loops thru an array until finding the first thru condition given by a callback function
  • without(array1, array2) : given 2 arrays will remove the second array from the first one if the first one ' contains the second one