1.0.1 • Published 6 years ago

@mshaok/lotide v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
6 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 @username/lotide

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): return 0 index value
  • middle(array): return middle value if odd, middle 2 if even
  • tail(array): return array of input array minus index 0
  • countLetters(String): counts how many letters in string
  • countOnly(array, itemsToCount): returns array of itemsToCount and how many appearances of itemsToCount
  • findKey(object, callback): returns the key from object if callback is true
  • findKeyByValue(object, value): returns first key from object with same valueas input
  • flatter(array): returns a newArray where there aren't any array inside the array
  • letterPosition(String): returns new object showing which letters appeared and at which position they occur
  • map(array, callback): returns a new array after doing callback to all items in array
  • takeUntil(array, callback): return array up until callback
  • without(arrayOne, arrayTwo): removes arrayTwo values from arrayOne