1.0.1 • Published 3 years ago

@tpampilon/lotide v1.0.1

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertEqual: Compares two datas and passes or fails it depending if they're equal or not.
  • head: Retrieves the first element from the array.
  • tail: Retrieves every element except the head (first element) of the array.
  • eqArrays: Compares two arrays and returns true or false it depending if they're equal or not.
  • assertEqual: A function for asserting that two arrays are equal.
  • without: Removes items from an array (items, itemsToRemove).
  • flatten: Turns nested arrays into single arrays.
  • middle: Returns the middle values of an array.
  • countLetters: counts how many times a letter appeared in a string.
  • countOnly: counts how many times a specific data appears in an array (allItems, itemsToCount).
  • letterPositions: returns the letters and the array index of the string.
  • findKeyByValue: finds a key inside an object using values.
  • eqObjects: Compares two objects and returns true or false it depending if they're equal or not.
  • assertObjectsEqual: A function for asserting that two objects are equal
  • takeUntil: Will produce a copy of the original array until the callback function has been met.
  • findKey: Will return an object's key as soon as the callback function has been met.
  • map: Creates a new array populated with the results of calling a provided function on every element in the calling array.
1.0.1

3 years ago

1.0.0

3 years ago