@apollo-annotation/common 0.3.9 → 0.3.10

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.9",
3
+ "version": "0.3.10",
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.9",
14
+ "@apollo-annotation/schemas": "^0.3.10",
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.9",
20
+ "@apollo-annotation/mst": "^0.3.10",
21
21
  "@gmod/gff": "^2.0.0",
22
22
  "@nestjs/common": "^10.1.0",
23
23
  "@nestjs/core": "^10.1.0",
@@ -1,4 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
+ import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
3
+
2
4
  import {
3
5
  Change,
4
6
  type ChangeOptions,
@@ -26,4 +28,24 @@ export abstract class AssemblySpecificChange extends Change {
26
28
  super(json, options)
27
29
  this.assembly = json.assembly
28
30
  }
31
+
32
+ getIndexedIds(
33
+ feature: AnnotationFeatureSnapshot,
34
+ idsToIndex: string[] | undefined,
35
+ ): string[] {
36
+ const indexedIds: string[] = []
37
+ for (const additionalId of idsToIndex ?? []) {
38
+ const idValue = feature.attributes?.[additionalId]
39
+ if (idValue) {
40
+ indexedIds.push(idValue[0])
41
+ }
42
+ }
43
+ if (feature.children) {
44
+ for (const child of Object.values(feature.children)) {
45
+ const childIndexedIds = this.getIndexedIds(child, idsToIndex)
46
+ indexedIds.push(...childIndexedIds)
47
+ }
48
+ }
49
+ return indexedIds
50
+ }
29
51
  }