Set.js 1.7 KB

12345
  1. //>>built
  2. (function(a){"object"===typeof module&&"object"===typeof module.exports?(a=a(require,exports),void 0!==a&&(module.exports=a)):"function"===typeof define&&define.amd&&define("require exports tslib ./global ./iterator ./support/has ./Symbol".split(" "),a)})(function(a,c){Object.defineProperty(c,"__esModule",{value:!0});var h=a("tslib"),k=a("./global"),e=a("./iterator"),l=a("./support/has");a("./Symbol");c.Set=k.default.Set;l.default("es6-set")||(c.Set=(g=function(){function a(a){this._setData=[];this[Symbol.toStringTag]=
  3. "Set";if(a)if(e.isArrayLike(a))for(var b=0;b<a.length;b++)this.add(a[b]);else try{for(var b=h.__values(a),f=b.next();!f.done;f=b.next())this.add(f.value)}catch(m){d={error:m}}finally{try{f&&!f.done&&(c=b.return)&&c.call(b)}finally{if(d)throw d.error;}}var d,c}a.prototype.add=function(a){if(this.has(a))return this;this._setData.push(a);return this};a.prototype.clear=function(){this._setData.length=0};a.prototype.delete=function(a){a=this._setData.indexOf(a);if(-1===a)return!1;this._setData.splice(a,
  4. 1);return!0};a.prototype.entries=function(){return new e.ShimIterator(this._setData.map(function(a){return[a,a]}))};a.prototype.forEach=function(a,c){for(var b=this.values(),d=b.next();!d.done;)a.call(c,d.value,d.value,this),d=b.next()};a.prototype.has=function(a){return-1<this._setData.indexOf(a)};a.prototype.keys=function(){return new e.ShimIterator(this._setData)};Object.defineProperty(a.prototype,"size",{get:function(){return this._setData.length},enumerable:!0,configurable:!0});a.prototype.values=
  5. function(){return new e.ShimIterator(this._setData)};a.prototype[Symbol.iterator]=function(){return new e.ShimIterator(this._setData)};return a}(),g[Symbol.species]=g,g));c.default=c.Set;var g});