Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
} catch (err) {
console.warn(`\nError parsing Idyll markup:\n${err.message}`);
return new Promise((resolve, reject) => reject(err));
}
let astTransform = Processor(output, options)
.pipe(hoistVariables)
.pipe(flattenChildren)
.pipe(makeFullWidth)
.pipe(wrapText)
.pipe(cleanResults)
.pipe(autoLinkify)
.end();
astTransform = convertV1ToV2(astTransform);
if (options.postProcessors) {
// Turn them all into promises
const promises = options.postProcessors.map(f => {
return ast => {
return new Promise((resolve, reject) => {
if (f.length === 2) {
f(ast, (err, value) => {
if (err) {
return reject(err);
}
resolve(value);
});
} else {
resolve(f(ast));
}