Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!pluginInstance.visitor) {
return pluginInstance;
}
let wrappedInstance = Object.assign({}, pluginInstance);
wrappedInstance.visitor = {};
for (let key of Object.keys(pluginInstance.visitor)) {
wrappedInstance.visitor[key] = function(path: any, state: any) {
state.opts = options;
return pluginInstance.visitor[key](path, state);
};
}
return wrappedInstance;
};
}
const template = compile(`
const parallelBabelShim = require('{{{js-string-escape here}}}').default;;
const config = {{{json-stringify config}}};
module.exports = parallelBabelShim(config);
`);
export function synthesize(config: any) {
return template({ here: __filename, config });
}
export function synthesizeGlobal(pluginInfo: any) {
let g = global as any;
if (!g.__embroiderSlowBabelPlugins__) {
g.__embroiderSlowBabelPlugins__ = [];
}
let index = g.__embroiderSlowBabelPlugins__.length;