@apollo-annotation/common 0.3.10 → 0.3.11

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": "@apollo-annotation/common",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/GMOD/Apollo3.git",
@@ -11,13 +11,13 @@
11
11
  "build": "tsc"
12
12
  },
13
13
  "dependencies": {
14
- "@apollo-annotation/schemas": "^0.3.10",
14
+ "@apollo-annotation/schemas": "^0.3.11",
15
15
  "@jbrowse/core": "^3.6.5",
16
16
  "bson-objectid": "^2.0.4",
17
17
  "tslib": "^2.3.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@apollo-annotation/mst": "^0.3.10",
20
+ "@apollo-annotation/mst": "^0.3.11",
21
21
  "@gmod/gff": "^2.0.0",
22
22
  "@nestjs/common": "^10.1.0",
23
23
  "@nestjs/core": "^10.1.0",
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
2
  import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
3
+ import { type Feature } from '@apollo-annotation/schemas'
3
4
 
4
5
  import {
5
6
  Change,
@@ -30,18 +31,27 @@ export abstract class AssemblySpecificChange extends Change {
30
31
  }
31
32
 
32
33
  getIndexedIds(
33
- feature: AnnotationFeatureSnapshot,
34
+ feature: AnnotationFeatureSnapshot | Feature,
34
35
  idsToIndex: string[] | undefined,
35
36
  ): string[] {
36
37
  const indexedIds: string[] = []
37
38
  for (const additionalId of idsToIndex ?? []) {
38
- const idValue = feature.attributes?.[additionalId]
39
+ const { attributes } = feature
40
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
41
+ const idValue: string[] =
42
+ attributes instanceof Map
43
+ ? attributes.get(additionalId)
44
+ : attributes?.[additionalId]
39
45
  if (idValue) {
40
46
  indexedIds.push(idValue[0])
41
47
  }
42
48
  }
43
49
  if (feature.children) {
44
- for (const child of Object.values(feature.children)) {
50
+ const childrenIterable =
51
+ feature.children instanceof Map
52
+ ? feature.children.values()
53
+ : Object.values(feature.children)
54
+ for (const child of childrenIterable) {
45
55
  const childIndexedIds = this.getIndexedIds(child, idsToIndex)
46
56
  indexedIds.push(...childIndexedIds)
47
57
  }