1.0.0 • Published 3 years ago

@jessemcdermott/lotide v1.0.0

Weekly downloads
41
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 @jessemcdermott/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(): Produces the 0 element in array
  • middle(): Produce middle elements of an array only
  • tail(): Removes first array element and produces the remaining array elements
  • assertArraysEqual(): tests a function and produces a passed or failed result for an array
  • assertEqual(): again tests a function and produces a passed or failed result
  • assertObjectsEqual(): again tests a function and produces a passed or failed result for an object
  • countLetters(): counts how many times a letter is present in an argument
  • countOnly(): counts how many times a string in present
  • countOnly(): counts how many times a string in present
  • eqArrays(): checks to see if 2 arrays match
  • eqObjects(): checks to see if 2 objects match
  • findKey(): finds the key in an object
  • findKeyByValue(): finds the key by it's value in an object
  • letterPositions(): checks the position/s of a letter in an argument
  • map(): checks to see if the position of a letter matches that passed in an argument
  • takeUntil: callsback an array based on it's argument
  • without(): will output only the shared elements of two arrays