utils

utils

Source:

Classes

Deferred

Methods

(static) joinLines(strings, values) → {String}

A small helper for multiline template strings that allows you to
not worry about new lines and indentations within your code from
breaking up the format of the string.

Since:
  • 2.5
Source:
Parameters:
Name Type Description
strings Array

an array of Strings from the template, broken up by
where the substitions are to be inserted.

values Array

an array of values to be inserted after each string
of a matching index.

Returns:
Type:
String

a template String without any prefixed or postfixed tabs
and other whitespaced characters.

(inner) promisify(method, context) → {function}

A simply promisify style function that returns an async function wrapped
around a supplied function designed for the standard callback methodology.
If the callback is the last parameter, and that callback is in the form of
(error, ...results) then this wrapper will do the trick for you.

Since:
  • 2.7.0
Source:
Parameters:
Name Type Description
method function

a function to wrap in an asynchronous function

context mixed

an optional this object for use with the supplied
function.

Returns:
Type:
function

an asynchronous function, i.e. one that returns a promise
containing the contents the callback results, that wraps the supplied
function.