1.0.0 • Published 8 months ago

@char.lopez11/lotide v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months 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 @char.lopez11/lotide

Require it:

const _ = require('@char.lopez11/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual: asserts if both arrays have the same data type and value.
  • assertEqual: asserts actual and expected values are the same.
  • assertObjectsEqual:asserts if both objects have the same data type and value.
  • countLetters: checks how many times a letter exists in a string.
  • countOnly: takes in an array of strings and an objects of items to search to return how many times it exists.
  • eqArrays: compares and checks if both arrays have the same data type and value.
  • eqObjects: compares and checks if both objects have the same data type and value.
  • findKey: takes in and object and callback as arguments to search for key and return key if callback returns true.
  • findKeyByValue: takes in and object and string as arguments to search for key and return key if it exists.
  • head: returns first item in array.
  • letterByPositions: takes in a string as argument to return an object of the index positions of each letter.
  • map: returns an new array based on callback function.
  • middle: returns the middle item in array.
  • tail: returns last item in array.
  • takeUntil: takes in an array and callback, return an array of items until callback is true.
  • without: return a new array with only those elements from source that are not present in the itemsToRemove array.
1.0.0

8 months ago