1.0.0 • Published 2 years ago

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

Require it:

const _ = require('prashanthk02/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: checks whether provided two arrays are equal.

  • assertEqual: checks whether provided two values are equal.

  • assertObjectsEqual: checks whether provided two objects are equal.
  • countLetters: gives the count of each letter in a provided string.
  • countOnly: gives the count of element in a provided array.
  • eqArrays: checks the equality of provided two arrays.
  • eqObjects: checks the equality of provided two objects.
  • findKey: finds the required key of the given object by given callback function.
  • findKeyByValue: finds the respective key from the given object by given key value.
  • head: returns the first element (head) of an array.
  • letterPositions: gives an object with letter and thier index in a given string.
  • map: takes an array and gives a new array as told to the call back function.
  • middle: takes an array, returns middle value as an array, if negative count returns middle one, if positive count returns middle two, if count is lessthan or equal to two returns empty array.
  • tail: takes an array, gives array excluding first element.
  • takeUntil: takes an array and call back, gives the array as mentioned to call back.
  • without: takes two arrays and gives only values of first array that are not in second array.