minimal-polyfills
Version:
An ultra light-weight, nonexhaustive, polyfills library
33 lines • 1.04 kB
JavaScript
;
exports.__esModule = true;
exports.Polyfill = exports.LightSetImpl = void 0;
var Map_1 = require("./Map");
var LightSetImpl = /** @class */ (function () {
function LightSetImpl(values) {
this.map = new Map_1.Polyfill();
if (values === undefined) {
return;
}
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
var value = values_1[_i];
this.add(value);
}
}
LightSetImpl.prototype.has = function (value) {
return this.map.has(value);
};
LightSetImpl.prototype.add = function (value) {
this.map.set(value, true);
return this;
};
LightSetImpl.prototype.values = function () {
return this.map.keys();
};
LightSetImpl.prototype["delete"] = function (value) {
return this.map["delete"](value);
};
return LightSetImpl;
}());
exports.LightSetImpl = LightSetImpl;
exports.Polyfill = typeof Set !== "undefined" ? Set : LightSetImpl;
//# sourceMappingURL=Set.js.map