1.0.0 • Published 5 years ago

@alysoncp/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

LoTide Readme

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

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: asserts two arrays are equal.
  • assertEqual: asserts two values are equal
  • assertObjectsEqual: asserts two objects are equal
  • countLetters: counts the letters in a string
  • eqArrays: compares two arrays
  • eqObjects: compares two objects
  • findKey: finds a key in an object
  • findKeyByValue: finds a key based on an entered value
  • head: takes the first item of an array
  • letterPositions: returns an object of arrays showing the indexes of letters occuring in a string
  • map: pulls the first letter from an array of words
  • tail: takes the last element in an array
  • takeUntil: takes the first n elements of an array until a given value
  • without: removes a given item from an array
  • middle: takes the value of the middle item(s) of an array of strings