1.0.0 • Published 2 years ago

@rj416/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 @rj416/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(head): find the head of an array
  • tail(tail): find the tail of an array
  • middle(middle): find the middle value(s) of an array
  • takeUntil(takeUntil): take an array until a certain value
  • assertArraysEqual(assertArraysEqual): compare two arrays
  • assertObjectsEqual(assertObjectsEqual): compare two objects
  • assertEqual(assertEqual): compare two values
  • countLetters(countLetters): count letters in a text
  • countOnly(countOnly): count only specified items
  • eqArrays(eqArrays): comparing arrays to evaluate whether they are identical
  • eqObjects(eqObjects): comparing objects to evaluate whether they are identical
  • findKey(findKey): find the first key that has the specified value or function
  • findKeyByValue(findKeyByValue): find the first key that has a specific value
  • flatten(flatten): flattens arrays
  • letterPositions(letterPositions): lists each letter by position
  • map(map): takes each item of an array and performs an action
  • without(without): removes item(s) from an array.
1.0.0

2 years ago