1.0.0 • Published 4 years ago

@richerob/lotide v1.0.0

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(...): returns the first element of an array
  • tail(...): returns the last two elements of an array
  • middle(...): returns the middle element / elements of an array
  • assertArraysEqual(...): compares two arrays and returns assertion passed if equal or assertion failed if not equal
  • eqArrays(...): compares two arrays and returns true if equal or false if not
  • assertEqual(...): compares two strings and returns assertion passed if equal or assertion failed if not equal
  • assertObjectsEqual(...): compares two objects and returns assertion passed if equal or assertion failed if not equal
  • eqObjects(...): compares two objects and returns true if equal or false if not equal
  • countLetters(...): returns the count of each character in the string
  • countOnly(...): returns the count of how many times an element is contained in an array
  • findKey(...): returns the key value for a property value
  • findKeyByValue(...): returns the key value of an object's property value
  • letterPositions(...): returns the index value of for each character in a string
  • map(...): returns a new array based on the original array and callback function
  • takeUntil(...): returns a new array based on the original array and callback function argument
  • without(...): returns a new array based on the original array based on the filtered criteria of the callback function argument
1.0.0

4 years ago