1.0.1 • Published 1 year ago

@jasonmac123/lotidever2 v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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 @JasonSnow123/LotideVer2

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(array): finds the first element of the array
  • middle(array): finds the middle element of the array, if there is even number then the middle two
  • tail(array): find the last element of the array
  • flatten(array): reduces nested array elements into one single array
  • takeuntil(array, condition): keeps adding elements from the array until condition is meet
  • countLetters(word): returns an object that contains the count for each letter in word
  • findKey(object, callback): returns the key within an object that satisfies the callback function
  • countOnly(items, condition ): counts the items that satisfy the condition and return undefined for objects that are not found
  • without(array, removeItems): returns a copy of the array with items removed that satisfy the removeItems condition
  • map(array, callback): alters each element of the array by the callback function used