1.0.0 • Published 4 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: assertion function determing if both arrays are identical.

  • assertEqual: utility function that acts as a simple version of the built-in assertion function.

  • assertObjectsEqual: assertion function that determines if an object is identical from the expected one.

  • countLetters: function that counts the letters of a string and places the number values in an object.

  • countOnly: function that looks through an array of names and counts how many times of particular names repeat and places those values within an object.

  • eqArrays: utility function that asserts if the the two given arrays have identical elements.

  • eqObjects: utility assertion function that determines if two objects are identical from one another.

  • findKey: function that finds the key, based on the objects value

  • findKeyByValue: function that finds the key from the value that it is given.

  • head: function that prints out the first element (head) of an array.

  • tail: function that prints out all elements expect for the head.

  • middle: function that prints out the middle elements of an array.

  • letterPositions: function that finds the index position of a letter from the given string

  • takeUntil: function that that takes elements from a given array, based on the condition in the callback function.

  • without: function that removes elements, based on the array given in the function and outputs a new array with the elements being removed.

  • map: function that acts similar to the .map method where it creates a new array based on the results of the callback function.