1.0.0 • Published 2 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArrayEqual(...): Compares arrays and logs the results as pass/fail
  • assertEqual(...): It compares two values and returns an assertion for equality
  • assertObjectsEqual(...): It compares two objects and returns a boolean for equality
  • countLetters(...): Returns the number of occurrences of a letter
  • countOnly(...): countOnly will be given an array and an object. It will return an object containing counts of everything that the input object listed.
  • eqArrays(...): compares two arrays for strict equality
  • eqObjects(...): compares two objects for strict equality
  • findKey(...): finds a specified key in an object
  • findKeyByValue(...): find key(s) that have a specified value
  • head(...): Returns the first element of an array
  • letterPositions(...): Maps each letter to a key and stores its index position(s) in an array from a given string
  • map(...): maps an array into a new array
  • middle(...): Grabs the middle element of an array, in the case of even length arrays, grabs the middle two elements
  • tail(...): returns all elements of an array except the first one
  • takeUntil(...): It applies a callback function to each element of the object
  • without(...): return a subset of a given array, removing unwanted elements