UNPKG

@rcsb/rcsb-saguaro-app

Version:
37 lines (36 loc) 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RcsbDistributionConfig = void 0; const tslib_1 = require("tslib"); const dcm = tslib_1.__importStar(require("./RcsbDistributionConfig.dc.json")); const distributionConfig = dcm; class RcsbDistributionConfig { constructor(dcm = distributionConfig) { this.trackToBlockType = new Map(); this.trackConfig = new Map(); this.blockConfig = new Map(); this.distributionConfig = dcm; this.processConfig(); } getBlockType(trackType) { return this.trackToBlockType.get(trackType); } getBlockConfig(type) { return this.blockConfig.get(type); } getTrackConfig(type) { return this.trackConfig.get(type); } processConfig() { this.distributionConfig.blockConfig.forEach(bc => { this.blockConfig.set(bc.type, bc); bc.trackType.forEach(type => { this.trackToBlockType.set(type, bc.type); }); }); this.distributionConfig.trackConfig.forEach(tc => { this.trackConfig.set(tc.type, tc); }); } } exports.RcsbDistributionConfig = RcsbDistributionConfig;