1.0.0 • Published 2 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArrayEqual(arrayOne, arrayTwo): determines if two arrays are equal
  • assertEqual(actual, expected): determines if two values are equal
  • countLetters(word): counts number of letters in a given word
  • countOnly(allItems, itemsToCount): counts number of occurences in an array based on another given value
  • eqArrays(arrayOne, arrayTwo): determines if two arrays are equal
  • eqObjects(actual, expected): determines if two objects are equal
  • findKey(object, callBack): finds key based on callback
  • findKeyByValue(object, value): returns value of given key based on value given
  • map(arr, callBack): similar to .map function
  • takeUntil(array, callback): slices from an array until stop condition is met
  • without(source, itemsToRemove): slices an array based on itemsToRemove
  • head(array): takes first index of an array
  • tail(array): takes everything other than index 0 from an array
  • middle(array): takes middle value(s) from an array