1.0.0 • Published 4 years ago

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • function1(...): description
  • function2(...): description
  • function3(...): description

  • assertArraysEqual: Compares 2 arrays as parameters and returns a pass if true, and a fail if fales

  • assertEqual: Compares 2 primitive data and returns a pass if true and false if fails
  • assertObjectsEqual: Compares 2 objects and returns a pass if true and false if fails
  • countLetters: Takes in a string as the parameter and logs and counts each character in the string and stores info in an object
  • countOnly: Takes in 2 objects, one with a list of items, and the second with a list of items and if they are true/false, then outputs only the items that were to be included
  • eqArrays: Checks and compares 2 arrays, if they are identicle it will return as true, if not false
  • eqObjects: Checks and compares 2 objects, if they are identicle it will return as true, if not false
  • findKey: Takes an object and uses a callback function to find matching values and return first key with said matchign values.
  • findKeyByValue: Finds a value in an object and returns the key it is in.
  • head: Returns head of the array
  • letterPositions: Looks at every letter in a string and logs its position in an object.
  • map: Looks at every letter in a string and logs its position in an object.
  • middle: Returns middle item/items in an array
  • tail: Returns everything in order, without the head of the array
  • takeUntil: Adds data from array until a certain condition is met from the callback function
  • without: Pulls two arrays, the array to be modified, and the array with what to remove