Dashboard sipadu mbip
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SimpleSet.js 674B

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = void 0;
  4. var SimpleSet =
  5. /*#__PURE__*/
  6. function () {
  7. function SimpleSet() {
  8. this.v = [];
  9. }
  10. var _proto = SimpleSet.prototype;
  11. _proto.clear = function clear() {
  12. this.v.length = 0;
  13. };
  14. _proto.has = function has(k) {
  15. return this.v.indexOf(k) !== -1;
  16. };
  17. _proto.add = function add(k) {
  18. if (this.has(k)) return;
  19. this.v.push(k);
  20. };
  21. _proto.delete = function _delete(k) {
  22. var idx = this.v.indexOf(k);
  23. if (idx === -1) return false;
  24. this.v.splice(idx, 1);
  25. return true;
  26. };
  27. return SimpleSet;
  28. }();
  29. exports.default = SimpleSet;
  30. module.exports = exports["default"];