Blame view

node_modules/less/test/plugins/visitor/index.js 710 Bytes
ce4c83ff   wxy   初始提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  (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);
          },
          visitDeclaration: 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);