1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/csso/lib/clean/index.js

21 lines
576 B
JavaScript
Raw Permalink Normal View History

2023-12-18 13:12:25 +08:00
var walk = require('css-tree').walk;
var handlers = {
Atrule: require('./Atrule'),
2024-01-16 21:26:16 +08:00
Comment: require('./Comment'),
2023-12-18 13:12:25 +08:00
Declaration: require('./Declaration'),
2024-01-16 21:26:16 +08:00
Raw: require('./Raw'),
Rule: require('./Rule'),
2023-12-18 13:12:25 +08:00
TypeSelector: require('./TypeSelector'),
WhiteSpace: require('./WhiteSpace')
};
module.exports = function(ast, options) {
walk(ast, {
leave: function(node, item, list) {
if (handlers.hasOwnProperty(node.type)) {
handlers[node.type].call(this, node, item, list, options);
}
}
});
};