UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

22 lines (21 loc) 895 B
import { B as f } from "./index-CpJXUZUB.js"; import { a1 as p } from "./JBrowsePanel-BNE3gNW1.js"; class N extends f.BaseAdapter { async getRefNameAliases() { const t = this.getConf("location"); if (t.uri === "" || t.uri === "/path/to/my/aliases.txt") return []; const o = await p.openLocation(t, this.pluginManager).readFile("utf8"), n = this.getConf("refNameColumn"), a = this.getConf("refNameColumnHeaderName"), s = o.trim().split(/\n|\r\n|\r/).filter((e) => !!e), r = s.filter((e) => e.startsWith("#")), l = a && r.length ? r.at(-1).slice(1).split(" ").map((e) => e.trim()).indexOf(a) : n; return s.filter((e) => !e.startsWith("#")).map((e) => { const i = e.split(" "); return { refName: i[l], aliases: i.filter((m) => !!m.trim()) }; }); } } export { N as default }; //# sourceMappingURL=RefNameAliasAdapter-Bqvy0Huc.js.map