UNPKG

dependency-injection-cat

Version:

DI Cat is a truly clean DI-container, which allows you not to pollute your business logic with decorators from DI/IOC libraries!

60 lines (59 loc) 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtendedSet = void 0; var ExtendedSet = /** @class */ (function () { function ExtendedSet(values) { this.set = new Set(values); } ExtendedSet.prototype.firstOrNull = function () { var _a; return (_a = this.list()[0]) !== null && _a !== void 0 ? _a : null; }; ExtendedSet.prototype.list = function () { return Array.from(this); }; Object.defineProperty(ExtendedSet.prototype, Symbol.toStringTag, { get: function () { return this.set[Symbol.toStringTag]; }, enumerable: false, configurable: true }); Object.defineProperty(ExtendedSet.prototype, "size", { get: function () { return this.set.size; }, enumerable: false, configurable: true }); ExtendedSet.prototype[Symbol.iterator] = function () { return this.set[Symbol.iterator](); }; ExtendedSet.prototype.add = function (value) { this.set.add(value); return this; }; ExtendedSet.prototype.clear = function () { this.set.clear(); }; ExtendedSet.prototype.delete = function (value) { return this.set.delete(value); }; ExtendedSet.prototype.entries = function () { return this.set.entries(); }; ExtendedSet.prototype.forEach = function (callbackfn, thisArg) { this.set.forEach(callbackfn, thisArg); }; ExtendedSet.prototype.has = function (value) { return this.set.has(value); }; ExtendedSet.prototype.keys = function () { return this.set.keys(); }; ExtendedSet.prototype.values = function () { return this.set.values(); }; return ExtendedSet; }()); exports.ExtendedSet = ExtendedSet;