1.0.0 • Published 4 years ago

@p-a-c/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 learning at Lighthouse Labs.

Usage

Install it:

npm install @p-a-c/lotide

Require it:

const _ = require('@p-a-c/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • head: a handy array head-of-array retriever
  • tail: a handy tail-of-array retriever
  • middle: a handy middle-of-array retriever
  • eqArrays: determines whether two arrays are equal
  • assertEqual: determines where the two arguments are equal
  • assertArraysEqual: a function to compare arrays and log to the console whether or not they are equal
  • countLetters: a function that counts only specified items in an array
  • findKey: finds object keys based on a property argument
  • map: Takes an array and a callback function a returns new array based on callback
  • takeUntil: a function that will return an array including items from the start of the given array up until the ending condition is met
  • without: A function for returning a new array with items removed
  • flatten: Takes nested arrays and makes one single array
  • countOnly: A function that counts only specified items in an array
  • letterPositions: A handy function that will tell you all the positions of all of the characters in a string
  • findKeyByValue: A handy function for finding the key of a value in an object
  • eqObjects: A function to testing if objects are equal. Able to test if object include arrays, but currently can't test if objects include objects
  • assertObjectsEqual: A function that will let you know if your objects are equal or not