1.0.4 • Published 4 years ago

@mighthire/lotide v1.0.4

Weekly downloads
-
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 @mighthire/lotide

Require it:

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

Call it:

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

Documentation

The following functions are currently implemented:

  • head(array): returns index 0 of an array
  • tail(array): returns index 0 of a length 1 array or splice(1) of a larger array
  • middle(array): returns a snarky string if array length is 2 or less, or returns the middle 1/2 indexes values.
  • flatten(array): returns a one-level nested array to one single array
  • countOnly(array, object: returns a count of items that are true in object from array
  • letterPositions(sentence): returns an object of arrays of letter posistions in the input sentence
  • findKeyByValue(object, string): return key of object.!key! = string
  • eqObjects(object1, object2): recursive compare objects
  • eqArrays(array1, array2): recursive compare arrays
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago