Blame view

天文台pc/tianwentai-ui/node_modules/react-transition-group/cjs/utils/SimpleSet.js 670 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  "use strict";
  
  exports.__esModule = true;
  exports.default = void 0;
  
  var SimpleSet = /*#__PURE__*/function () {
    function SimpleSet() {
      this.v = [];
    }
  
    var _proto = SimpleSet.prototype;
  
    _proto.clear = function clear() {
      this.v.length = 0;
    };
  
    _proto.has = function has(k) {
      return this.v.indexOf(k) !== -1;
    };
  
    _proto.add = function add(k) {
      if (this.has(k)) return;
      this.v.push(k);
    };
  
    _proto.delete = function _delete(k) {
      var idx = this.v.indexOf(k);
      if (idx === -1) return false;
      this.v.splice(idx, 1);
      return true;
    };
  
    return SimpleSet;
  }();
  
  exports.default = SimpleSet;
  module.exports = exports.default;