@jbrowse/core
Version:
JBrowse 2 core libraries used by plugins
31 lines (30 loc) • 1.21 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseAdapter = void 0;
const mobx_state_tree_1 = require("mobx-state-tree");
const configuration_1 = require("../../configuration");
const idMaker_1 = __importDefault(require("../../util/idMaker"));
const EmptyConfig = (0, configuration_1.ConfigurationSchema)('empty', {});
class BaseAdapter {
constructor(config = EmptyConfig.create(), getSubAdapter, pluginManager) {
this.config = config;
this.getSubAdapter = getSubAdapter;
this.pluginManager = pluginManager;
if (typeof jest === 'undefined') {
const data = (0, mobx_state_tree_1.isStateTreeNode)(config) ? (0, mobx_state_tree_1.getSnapshot)(config) : config;
this.id = `${(0, idMaker_1.default)(data)}`;
}
else {
this.id = 'test';
}
}
getConf(arg) {
return (0, configuration_1.readConfObject)(this.config, arg);
}
freeResources(_region) { }
}
exports.BaseAdapter = BaseAdapter;
BaseAdapter.capabilities = [];