1.0.0 • Published 4 years ago

@padofreo/lotide v1.0.0

Weekly downloads
1
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 @padofreo/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(...) : Takes the first element
  • tail(...) : Takes the end element
  • middle(...) : Takes the middle element of an arry
  • countOnly(...) : Counts how many times a name appears in an object
  • countLetters(...) : Counts the number of times a letter appears in a string
  • findKey(...) : Returns the key by referencing it's value
  • findKeyByValue(...) : Returns the key by referencing it's value
  • flatten(...) : Flattens a nested array
  • letterPositions(...): Returns the index position of a letter in a string
  • map(...) : Returns a letter from an array by position
  • pigLatin(...) : Turns words into pig latin
  • reverse(...) : Reverses a word
  • takeUntil,(...) : Returns an array until condition has been met
  • without(...) : Removes specified items from an array