1.0.0 • Published 4 years ago

@mrklep90/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 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 @mrklep90/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(...): returns the first item in an array
  • middle(...): returns the middle item, or items, in an array
  • tail(...): returns every item in an array after the first
  • countLetters(...): returns, as an array, each letter in a given string and how many times each letter ocurred
  • countOnly(...): returns an object that contains how many items were counted in a provided array based on a provided criteria
  • findKey(...): returns the key in an object that is associated with a given value (formatted as a callback)
  • findKeyByValue(...): eturns the key in an object that is associated with a given value
  • letterPositions(...): returns, as an object, the unique letters in a given string and what index positions they are located at
  • map(...): returns an array populated with the results of calling a given function on each item in the array
  • takeUntil(...): returns an array populated with the values of a given array up until a given stopping point
  • without(...): returns an array populated with the remaining values of a given array after specified items are removed