14 lines
350 B
JavaScript
14 lines
350 B
JavaScript
export default function(node, {evaluate, scope}) {
|
|
const elements = [];
|
|
let isAsync = false;
|
|
for (const element of node.elements) {
|
|
const {async, value} = evaluate(element, {scope});
|
|
isAsync = isAsync || async;
|
|
elements.push(value);
|
|
}
|
|
return {
|
|
async: !!isAsync,
|
|
value: isAsync ? Promise.all(elements) : elements,
|
|
};
|
|
}
|