1.0.0 • Published 4 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(...): it will return the head of an array
  • tail(...): it will return the tail of an array
  • middle(...): it will return the middle of an array
  • assertArraysEqual(...) : it will assert equal Arrays
  • assertEqual(...) : it will assert equal expressions
  • assertObjectsEqual(...) : it will assert equal objects
  • countLetters(...) : count letters in a string
  • countOnly(...) : count only given items to count in an array
  • eqArrays(...) : check if 2 arrays are equal
  • eqObjects(...) : check if 2 objects are equal
  • findKey(...) : find key of object according to the callback function
  • findKeyByValue(...) :find key of object according to the given value
  • letterPositions(...) : find letter positions in a string
  • map(...) : new array created according to the function
  • takeUntil(...) : array return take until a particular value appears
  • without(...) : array will return without certain elements
  • flatten(...) :a nested array will be flattened to regular array.
1.0.0

4 years ago