1.0.0 • Published 2 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(actual, expected): asserts whether or not actual array is expected array
  • assertEqual(actual, expected): asserts whether actual is expected
  • assertObjectsEqual(object1, object2): asserts whether actual object is equal to expected object
  • countLetters(string): counts the letters of a string
  • countOnly(allItems, itemsToCount): counts only specified items from given parameters
  • eqArrays(array1, array2): inspects if two arrays are equal
  • eqObjects(object1, object2): inspects if two objects are equal
  • findKey(object, callback): returns the key name of given parameters
  • findKeyByValue(object, value): returns key name by searching by value
  • head(array1): returns first element of an array
  • letterPositions(string): returns index positions of letters within a string
  • map(array, callback): returns new array based on results of callback
  • middle(array): returns middle most element(s) of the given array
  • tail(array1): returns every element of array except the first element
  • takeUntil(data, callback): returns section of given array until the callback parameters
  • without(source, itemsToRemove): returns array with items removed