Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (legacy) {
return {
name: "proposal-decorators",
inherits: syntaxDecorators,
manipulateOptions({ generatorOpts }) {
generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
},
visitor: legacyVisitor,
};
}
return createClassFeaturePlugin({
name: "proposal-decorators",
feature: FEATURES.decorators,
// loose: options.loose, Not supported
manipulateOptions({ generatorOpts, parserOpts }) {
parserOpts.plugins.push(["decorators", { decoratorsBeforeExport }]);
generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
},
});
});