Opal-Estate-Pro/node_modules/csso/lib/compressor/compress/index.js
2019-09-13 11:27:52 +07:00

23 lines
724 B
JavaScript
Executable File

var walk = require('../../utils/walk.js').all;
var handlers = {
Atrule: require('./Atrule.js'),
Attribute: require('./Attribute.js'),
Value: require('./Value.js'),
Dimension: require('./Dimension.js'),
Percentage: require('./Number.js'),
Number: require('./Number.js'),
String: require('./String.js'),
Url: require('./Url.js'),
Hash: require('./color.js').compressHex,
Identifier: require('./color.js').compressIdent,
Function: require('./color.js').compressFunction
};
module.exports = function(ast) {
walk(ast, function(node, item, list) {
if (handlers.hasOwnProperty(node.type)) {
handlers[node.type].call(this, node, item, list);
}
});
};