@sjcrh/proteinpaint-shared 2.79.2 → 2.79.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-shared",
3
- "version": "2.79.2",
3
+ "version": "2.79.4",
4
4
  "description": "ProteinPaint code that is shared between server and client-side workspaces",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -15,7 +15,7 @@ export * from './termdb.initbinconfig.js'
15
15
  export * from './termdb.usecase.js'
16
16
  export * from './terms.js'
17
17
  export * from './tree.js'
18
- // do `npm run esm` to generate js file from ts file
18
+ // do `npm run esm` to generate .js file from .ts file
19
19
  export * from './urljson.js'
20
20
  export * from './vcf.ann.js'
21
21
  export * from './vcf.csq.js'
package/src/terms.js CHANGED
@@ -163,11 +163,11 @@ export function getSampleType(term, ds) {
163
163
  }
164
164
 
165
165
  export function getParentType(types, ds) {
166
- if (ds.cohort.termdb.sampleTypes.size == 0) return null //dataset only has one type of sample
166
+ if (Object.keys(ds.cohort.termdb.sampleTypes).length == 0) return null //dataset only has one type of sample
167
167
  const ids = Array.from(types)
168
168
  if (!ids || ids.length == 0) return null
169
169
  for (const id of ids) {
170
- const typeObj = ds.cohort.termdb.sampleTypes.get(id)
170
+ const typeObj = ds.cohort.termdb.sampleTypes[id]
171
171
  if (typeObj.parent_id == null) return id //this is the root type
172
172
  //if my parent is in the list, then I am not the parent
173
173
  if (ids.includes(typeObj.parent_id)) continue