lix-website/themes/lix/assets/bootstrap/node_modules/eslint-template-visitor/test/_drop-extra-top-level-nodes.js
2024-04-26 22:49:34 -06:00

17 lines
265 B
JavaScript

module.exports = ast => {
ast.directives = [];
if (ast.type === 'Module') {
if (ast.items.length > 1) {
ast.items.length = 1;
}
} else if (ast.type === 'Script') {
if (ast.statements.length > 1) {
ast.statements.length = 1;
}
}
return ast;
};