1.0.0 • Published 4 years ago

@izzybella12/lotide v1.0.0

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(): returns the first element of an inputed array
  • tail(): returns the last element of an inputed array
  • eqArrays(...): returns true or false based on a perfect match between two arrays
  • assertEqual(...): compares an inputted actual and expected value and returns message
  • assertArraysEqual: returns a message based on the result of eqArrays
  • without(...): returns the subset of a given array, removing unwanted elements
  • middle(): returns the middle-most element(s) of an inputted array
  • countLetters(...): returns a letter count of the letters of an inputted string
  • countOnly(...): returns an object counting everything the input object listed
  • letterPositions(...): returns the letter positions found in an inputted string
  • findKeyByValue(...): scans inputted object, finds first key containing inputted value
  • eqObjects(...): returns true or false based on a perfect match between two objects
  • assertObjectsEqual(...): returns a message based on the result of eqObjects
  • takeUntil(...): collects items from inputted array until inputted callback is truthy
  • findKey(...): scans inputted object, returns 1st key making inputted callback truthy
  • map(...): returns a new array based on the results of the callback function