1.0.1 • Published 5 years ago

@cleozhang/lotide v1.0.1

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(...): Assert if two arrays equal.
  • assertEqual(...): Assert if two inputs equal.
  • assertObjectsEqual(...): Assert if two objects equal.
  • countLetters(...): Count letter frequencies in a String.
  • countOnly(...): Count the number of occurrences for the given word.
  • eqArrays(...): Compares two arrays equal.
  • eqObjects(...): Compares two objects equal.
  • findKey(...): Returns the key for the given number.
  • findKeyByValue(...): Returns the key for the given value.
  • flatten(...): Returns an array of Strings with the given input array (of array).
  • letterPositions: Return an object of pairs of letter with its occurrences.
  • map: Returns an array of individual letter for the input String.
  • takeUntil: Return an array with elements filtered out by the given condition.
  • without: Return an array without the given values.
  • head: Return the first element of the array.
  • tail: Return the rest of the element of the array except the first element.
  • middle: Returns the middle elements of the array.