1.0.0 • Published 2 years ago

@mwoods0157/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 Matthew Woods as part of my learnings at Lighthouse Labs.

Usage

Install it:

npm install @mwoods0157/lotide

Require it:

const matty = require('@mwoods0157/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(...): asserts whether 2 arrrays are equal (t/f)
  • assertEqual(...): asserts whether 2 primative types are equal (t/f)
  • assertObjectEqual(...): asserts whether 2 objects are equal (t/f)
  • countLetters(...): counts the number of letters within a string input
  • countOnly(...): counts the number of times a letter appears within a string
  • eqArrays(...): tests the equality of 2 arrays which are inputs
  • eqObject(...): tests the equality of 2 objects which are inputs
  • findKey(...): returns the first value of an object given its key
  • findKeyByValue(...): returns the first key of an object given its value
  • flatten(...): returns array with single level from an input with mutliple array levels
  • head(...): returns the first array element given an array
  • index(...): used with mocha/chai for async JS to export object methods
  • letterPosition(...): returns the indices of all letters within an input string
  • map(...): custom map function for arrays
  • middle(...): returns the middle value of an input array
  • tail(...): returns the tail array of an input array
  • takeUntil(...): returns an array of values with the tail section which starts being removed at input value
  • without(...): returns an array of values which have had their input value spliced out