1.0.0 • Published 3 years ago

@masinejad/lotide v1.0.0

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArrayEqual(arrayOne,arrayTwo): accept 2 arrays and compare them.
  • assertEqual(actual, expected): accept 2 parameters and compare them.
  • assertObjectEqual(object1, expected): accept 2 objects and compare them.
  • countletter(str) : accept a string and count it's letter.
  • countOnly(allItem, itemsToCount) : accept an object and a number and count the specified key
  • eqArray(arrayOne, arrayTwo) : accept 2 arrays and compare them.
  • eqObject(object1, object2) : accepts 2 object with the key as object and compare them.
  • findKey(myObject, callback) : find specified key.
  • findKeyByValue(myObject, value) : find key based on it's value.
  • head(array) : accept an array and return first element.
  • letterPosition(sentence) : accept a sentence and retrun position specified letter.
  • map(array, callback) : accept and array and return result based on consdition.
  • tail(array) : return tail of array.
  • takeUntil(array, callback) : return result based on the condition.
  • without(source, itemToRemove) : accept an array and removes specified item