Namespace: util

util

Members

(static, constant) exports.collectMetadata

Utility which creates a function that extracts metadata
from the server in the response to a pipeline request,
and attaches it to the final result after the finalizer has been applied.

Methods

(static) exports.deprecate(fn, msg)

Utility function for displaying deprecation notices

Parameters:
Name Type Description
fn function

the function to deprecate

msg String

the message to display to the user regarding deprecation

(static) exports.serviceResponse(service, action, args) → {Promise}

Utility method for executing a service action as a function call.

Parameters:
Name Type Description
service Object

the service to execute the action on

action String

the service action to execute

args Array

the arguments to supply to the service action invocation

Returns:

the API response from the executed service action

Type
Promise

(static) exports.uriEncodeObject(obj) → {String}

Utility function to encode a JSON object into a valid string that can be
inserted in a URI. The object is first stringified, then encoded in base64,
and finally encoded via the builtin encodeURIComponent function.

Parameters:
Name Type Description
obj Object

The object to encode

Returns:

The encoded object

Type
String