项目原始demo,不改动
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
 
 
 
 

33 行
1.0 KiB

  1. "use strict";
  2. var root_1 = require('./root');
  3. function minimalSetImpl() {
  4. // THIS IS NOT a full impl of Set, this is just the minimum
  5. // bits of functionality we need for this library.
  6. return (function () {
  7. function MinimalSet() {
  8. this._values = [];
  9. }
  10. MinimalSet.prototype.add = function (value) {
  11. if (!this.has(value)) {
  12. this._values.push(value);
  13. }
  14. };
  15. MinimalSet.prototype.has = function (value) {
  16. return this._values.indexOf(value) !== -1;
  17. };
  18. Object.defineProperty(MinimalSet.prototype, "size", {
  19. get: function () {
  20. return this._values.length;
  21. },
  22. enumerable: true,
  23. configurable: true
  24. });
  25. MinimalSet.prototype.clear = function () {
  26. this._values.length = 0;
  27. };
  28. return MinimalSet;
  29. }());
  30. }
  31. exports.minimalSetImpl = minimalSetImpl;
  32. exports.Set = root_1.root.Set || minimalSetImpl();
  33. //# sourceMappingURL=Set.js.map