1.0.1 • Published 3 years ago

@hunterapril94/lotide v1.0.1

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: this compares if arrays are equal and throws a message to let you know if it passes or fails
  • assertEqual: compares strings and numbers for equality and throws message to let you know the results
  • assertObjectsEqual: compares objects for equality and throws a message to let you know the results
  • countLetters: counts letters in a string
  • countOnly: counts only specified content
  • eqArrays: compares arrays for equality
  • eqObjects: compares objects for equality
  • findKey: searches an object for a certain key
  • findKeyByValue: searches an object for a key when given its value
  • flatten: turns nested arrays into one 2d array
  • head: returns the first value in an array
  • letterPositions: returns an array with all the positions in which a certain letter occurs
  • map: maps to a new array
  • middle: returns the middle value in an array
  • tail: returns the final value in an array
  • takeUntil: slices an array at a certain given value
  • without: returns an array without a given value