Global

Methods

isPromise(value) → {Boolean}

Returns whether an object is Promise-like (i.e. has a then method).

Parameters:
Name Type Description
value Object

An object that may or may not be Promise-like.

Returns:
Boolean -

Whether or not the object is Promise-like.

module:merge-options(sources) → {Object}

Deep-merge one or more options objects, recursively merging only plain object properties.

Parameters:
Name Type Description
sources Array.<Object>

One or more objects to merge into a new object.

Returns:
Object -

A new object that is the merged result of all sources.

silencePromise(value)

Silence a Promise-like object.

This is useful for avoiding non-harmful, but potentially confusing "uncaught play promise" rejection error messages.

Parameters:
Name Type Description
value Object

An object that may or may not be Promise-like.