UNPKG

@triviality/core

Version:
81 lines 3.05 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread = (this && this.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var ramda_1 = require("ramda"); exports.REGISTER_MAP_ARGUMENTS = Symbol.for('REGISTER_MAP_ARGUMENTS'); function makeImmutableRegistryMap() { var services = []; for (var _i = 0; _i < arguments.length; _i++) { services[_i] = arguments[_i]; } return ImmutableRegistryMap.create.apply(ImmutableRegistryMap, __spread(services)); } exports.makeImmutableRegistryMap = makeImmutableRegistryMap; var ImmutableRegistryMap = /** @class */ (function (_super) { __extends(ImmutableRegistryMap, _super); /* istanbul ignore next */ function ImmutableRegistryMap() { return _super.call(this) || this; } ImmutableRegistryMap.create = function () { var items = []; for (var _i = 0; _i < arguments.length; _i++) { items[_i] = arguments[_i]; } var instance = Object.create(ImmutableRegistryMap.prototype); var map = new Map(items); map.forEach(function (value, key) { instance.push([key, value]); }); Object.freeze(instance); return instance; }; ImmutableRegistryMap.prototype.register = function () { var services = []; for (var _i = 0; _i < arguments.length; _i++) { services[_i] = arguments[_i]; } return ImmutableRegistryMap.create.apply(ImmutableRegistryMap, __spread(this, services)); }; ImmutableRegistryMap.prototype.toArray = function () { return __spread(this); }; ImmutableRegistryMap.prototype.toObject = function () { return ramda_1.fromPairs(this); }; return ImmutableRegistryMap; }(Array)); exports.ImmutableRegistryMap = ImmutableRegistryMap; //# sourceMappingURL=ImmutableRegistryMap.js.map