1.0.0 • Published 5 years ago

@jackylau/lotide v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 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 @jackylau/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • assertArraysEqual(...): To compare multiple expressions of arrays
  • assertEqual(...): To compare multiple expressions or things; usually strings
  • assertObjectsEqual(...): To compare multiple expressions in the form of objects
  • countLetters(...): To count how many letters that are repeated in a given input
  • countOnly(...): To count the only the input value and also return how many times the specify values are repeated
  • eqArrays(...): To compare if multiple arrays are the same including their specific elements within
  • eqObjects(...): To compare if multiple objects inputted are the same by matching the same values within
  • findKey(...): To find the key of an object
  • findKeyByValue(...): To find the key of an object by using its' dedicated value
  • flatten(...): To remove an array of an array and return the specified value or input
  • head(...): To return the first element of a string or an array
  • letterPositions(...): To return the position or positions of the inputted characters/words/phrases in a string
  • map(...): To make a new array from a function that calls for every element in a array
  • middle(...): To return the middle element of an array; if array is odd, return a single element; if even, return an array with 2; if single element array return []
  • tail(...): To return a new array with the specify element including the ones after from an array
  • takeUntil(...): To return a new array with the specify range
  • without(...): To remove an array from another array