1.0.1 • Published 4 years ago

@flora.manda/lotide v1.0.1

Weekly downloads
1
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 learnings at Lighthouse Labs.

Usage

Install it:

npm install @flora.manda/lotide

Require it:

const _ = require('@flora.manda/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • head(...): function to find head of an array
  • tail(...): function to find tail of an array
  • middle(...): function to find middle element of an array
  • assertArraysEqual(...): function to compare two arrays
  • assertEqual(...): function to compare two values that is not an array or object
  • assertObjectsEqual(...): function to compare two objects
  • countLetters(...): function to find the number of character instances in a string
  • countOnly(...): function to count number of instances a string appears in an array
  • eqArrays(...): function that returns a boolean if two arrays are equal or not
  • eqObjects(...): function that returns a boolean if two objects are equal or not
  • findKey(...): function that finds the key in an object based on a second arg (a callback)
  • findKeyByValue(...): function that finds the key in an object based on a second arg (a value)
  • flatten(...): function that flattens an array
  • letterPositions(...): function that finds the position of a string and return value in an object
  • map(...): function that returns a modified array based on a call back function
  • takeUntil(...): function that returns an array with elements up until a certain point declared by a callback
  • without(...): function that returns an array without certain elements based on the second arg (what items to remove)