src/reference-variables.js
/**
		 * Process a ReferenceVariableWaiter, invoke the callback when all Reference
		 * Variables it needs are available.
		 *
		 * @param {ReferenceVariableWaiter} waiter
		 * @return {Promise<any>}
		 */
Process a ReferenceVariableWaiter, invoke the callback when all Reference
Variables it needs are available.

@param {ReferenceVariableWaiter} waiter
@return {Promise}
Process a ReferenceVariableWaiter invoke the callback when all Reference Variables it needs are available . @param { ReferenceVariableWaiter } waiter @return { Promise }
async function processRefVarWaiter(waiter) {
			if (!(waiter instanceof ReferenceVariableWaiter)) {
				throw new TypeError(`expect first argument (for Reference Variable Waiter) to be a ReferenceVariableWaiter instance`);
			}
			const {refPaths, callback} = waiter;
			let result;
			if (refPaths === undefined) {
				return callback(undefined, getRefVar);
			}
			if (isString(refPaths)) {
				result = await getRefVar(refPaths);
			} else if (Array.isArray(refPaths)) {
				result = await Promise.all(refPaths.map(refPath => getRefVar(refPath)));
			} else {
				const keys = Object.keys(refPaths);
				result = (await Promise.all(keys.map(key => getRefVar(refPaths[key])))).reduce((r, v, i) => {
					r[keys[i]] = v;
					return r;
				}, {});
			}
			return callback(result, getRefVar);
		}
async function processRefVarWaiter ( waiter ) { if ( ! ( waiter instanceof ReferenceVariableWaiter ) ) { throw new TypeError ( ` ` ) ; } const { refPaths , callback } = waiter ; let result ; if ( refPaths === undefined ) { return callback ( undefined , getRefVar ) ; } if ( isString ( refPaths ) ) { result = await getRefVar ( refPaths ) ; } else if ( Array . isArray ( refPaths ) ) { result = await Promise . all ( refPaths . map ( refPath => getRefVar ( refPath ) ) ) ; } else { const keys = Object . keys ( refPaths ) ; result = ( await Promise . all ( keys . map ( key => getRefVar ( refPaths [ key ] ) ) ) ) . reduce ( ( r , v , i ) => { r [ keys [ i ] ] = v ; return r ; } , { } ) ; } return callback ( result , getRefVar ) ; }
Process a ReferenceVariableWaiter, invoke the callback when all Reference
 Variables it needs are available.
Process a ReferenceVariableWaiter invoke the callback when all Reference Variables it needs are available .