1.0.1 • Published 2 years ago

@dustingrof/lotide v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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. It is some of my very first programming using javascript.

Usage

Install it:

npm install @dustingrof/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(): get first item in an array
  • tail(): get last item in an array
  • middle(): get middle item/items in an array
  • countLetters(): count the letters in a string
  • countOnly(): count only specific things
  • findKey(): find the key in an object
  • findKeyByValue(): find key by value
  • letterPositions(): find the position of a letter in a string
  • map(): a simple version of map
  • takeUntil(): take the first part of an array up until
  • without(): return an array without certain items
  • assertArraysEqual(): assert if arrays sure arrays are equal
  • assertEqual(): compare two strings and assert if they are equal
  • eqObjects(): check if objects are equal
  • eqArrays(): return true or false if arrays are equal