1.0.0 • Published 2 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(...): tests that 2 arrays are qual
  • assertEqual(...): tests that 2 inputs are equal
  • assertObjectEqual(...): tests that 2 obje ts are equal
  • countLetters(...): test that shows how many times a letter appears in a string
  • countOnly(...): test that coounts how many times a string appears in an array
  • eqArray(...): test that 2 arrays are equal
  • eqObject(...): test that 2 objects are equal
  • findKeyByValue(...): test to find a key by value in an object
  • findKey(...): test to find a key in an object
  • head(...): test to print the 1st element in amn array
  • letterPositions(...): test to print the the position of letters in an string
  • map(...): test to return the first letter of each string in an array
  • middle(...): test to give the middle eleemnt in an array
  • tail(...): test to print everthing but the 1st element in an array
  • without(...): test to print whats missing in the 1st array when compared with another
  • takeUntil(...): descriptiontest to return elements in an array till a certain vale in the input array