1.0.2 • Published 2 years ago

@2san/lotide v1.0.2

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.

Usage

Install it:

npm install @2san/lotide

Require it:

const _ = require('@2san/lotide');

Call it:

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

Documentation

The following functions are currently implemented:

  • head(...): retrieves head value or first element in an array
  • tail(...): retrieves tail values or elements in array starting from index 1
  • middle(...): retrieves middle elements in an array, will return an array with two elements if original array is of even length.
  • assertEqual(...): Colorful Assertion test, checks if two values are === equal
  • assertArraysEqual(...): Colorful Assertion test to be used on array values. checks if two arrays are equal.

  • countOnly(...): counts items in array based on objects marked as true

  • eqArrays(...): checks recursively if arrays are equal
  • eqObjects(...): checks objects recursively if they are equal
  • letterPositions(...): stores character letter positions from a string
  • flatten(...): flattens arrays one layer
  • findKeyByValue(...): retrieves keys from object using a value

The following functions are working, but do not have tests completed: assertObjectsEqual, countLetters, findKey, map, takeUntil, without,

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago