1.0.0 • Published 2 years ago

@youssefragab/lotide v1.0.0

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(head): returns the first value of an array
  • function2(tail): returns array without the first value
  • function3(middle): returns middle values(s) of the array
  • function4(countLetters): returns letter count in a given string
  • function5(countOnly): counts how many items to count from an all items array
  • function6(findKey): returns key name given a provided object attribute
  • function7(findKeyByValue): returns key value given a provided object attribute
  • function8(flatten): transforms nested arrays into a simple array
  • function9(letterPositions): returns letter positions of a given letter in a string
  • function10(map): takes each value of an array and executes a callback function on them
  • function11(takeUntil): returns array until it reaches takeUntil value (not included)
  • function12(without): returns an array excluded gven "without" values

    head, tail, middle, countLetters, countOnly, findKey, findKeyByValue, flatten, letterPositions, map, takeUntil, without