UNPKG

@typeheim/orm-on-fire

Version:
24 lines 769 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CollectionMap = void 0; class CollectionMap { constructor(factory) { this.factory = factory; this.storage = new Map(); this.groupStorage = new Map(); } of(entity) { if (!this.storage.has(entity)) { this.storage.set(entity, this.factory.createFor(entity)); } return this.storage.get(entity); } groupOf(entity) { if (!this.groupStorage.has(entity)) { this.groupStorage.set(entity, this.factory.createGroupFor(entity)); } return this.groupStorage.get(entity); } } exports.CollectionMap = CollectionMap; //# sourceMappingURL=CollectionMap.js.map