src/util/Util.js
/**
 * Convert the resulting value of a promise into a tupple.
 *
 * @name module:util.promiseToTupple
 * @function
 * @public
 * @param {Promise} promise - the promise
 * @return {Object[]} the resulting value in the format [error, return data]
 * where error is null if there was no error
 */
Convert the resulting value of a promise into a tupple.
Convert the resulting value of a promise into a tupple .
function promiseToTupple(promise)
{
	return promise
		.then((data) => [null, data])
		.catch((error) => [error, null]);
}
function promiseToTupple ( promise ) { return promise . then ( ( data ) => [ null , data ] ) . catch ( ( error ) => [ error , null ] ) ; }
Convert the resulting value of a promise into a tupple.
Convert the resulting value of a promise into a tupple .