pixsy/node_modules/less/test/plugins/visitor/index.js

25 lines
703 B
JavaScript
Raw Normal View History

2017-12-22 17:22:08 +00:00
(function(exports) {
var RemoveProperty = function(less) {
this._visitor = new less.visitors.Visitor(this);
};
RemoveProperty.prototype = {
isReplacing: true,
run: function (root) {
return this._visitor.visit(root);
},
visitRule: function (ruleNode, visitArgs) {
if (ruleNode.name != '-some-aribitrary-property') {
return ruleNode;
} else {
return [];
}
}
};
exports.install = function(less, pluginManager) {
pluginManager.addVisitor( new RemoveProperty(less));
};
})(typeof exports === 'undefined' ? this['VisitorPlugin'] = {} : exports);