gff-nostream 3.0.11 → 5.0.0

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/README.md CHANGED
@@ -19,92 +19,26 @@ import fs from 'fs'
19
19
  const features = parseStringSync(fs.readFileSync('my_annotations.gff3', 'utf8'))
20
20
  ```
21
21
 
22
- For browser or other non-Node environments, pass any GFF3 string directly — for
23
- example from `fetch`:
22
+ In the browser or other non-Node environments, pass any GFF3 string directly —
23
+ for example from `fetch`:
24
24
 
25
25
  ```js
26
- import { parseStringSyncJBrowse } from 'gff-nostream'
26
+ import { parseStringSync } from 'gff-nostream'
27
27
 
28
28
  const text = await fetch('my_annotations.gff3').then(r => r.text())
29
- const features = parseStringSyncJBrowse(text)
29
+ const features = parseStringSync(text)
30
30
  ```
31
31
 
32
32
  ## Object format
33
33
 
34
- ### GFF3 format
35
-
36
- Features are returned as arrays of all lines sharing the same ID (to represent
37
- multi-location features). Values that are `.` in GFF3 are `null` in the output.
38
-
39
- A simple feature located in one place:
40
-
41
- ```json
42
- [
43
- {
44
- "seq_id": "ctg123",
45
- "source": null,
46
- "type": "gene",
47
- "start": 1000,
48
- "end": 9000,
49
- "score": null,
50
- "strand": "+",
51
- "phase": null,
52
- "attributes": {
53
- "ID": ["gene00001"],
54
- "Name": ["EDEN"]
55
- },
56
- "child_features": [],
57
- "derived_features": []
58
- }
59
- ]
60
- ```
61
-
62
- A CDS called `cds00001` located in two places:
63
-
64
- ```json
65
- [
66
- {
67
- "seq_id": "ctg123",
68
- "source": null,
69
- "type": "CDS",
70
- "start": 1201,
71
- "end": 1500,
72
- "score": null,
73
- "strand": "+",
74
- "phase": "0",
75
- "attributes": {
76
- "ID": ["cds00001"],
77
- "Parent": ["mRNA00001"]
78
- },
79
- "child_features": [],
80
- "derived_features": []
81
- },
82
- {
83
- "seq_id": "ctg123",
84
- "source": null,
85
- "type": "CDS",
86
- "start": 3000,
87
- "end": 3902,
88
- "score": null,
89
- "strand": "+",
90
- "phase": "0",
91
- "attributes": {
92
- "ID": ["cds00001"],
93
- "Parent": ["mRNA00001"]
94
- },
95
- "child_features": [],
96
- "derived_features": []
97
- }
98
- ]
99
- ```
100
-
101
- ### JBrowse format
102
-
103
- The `JBrowse` variants return flat objects with coordinates converted to 0-based
34
+ Features are returned as flat objects with coordinates converted to 0-based
104
35
  half-open, `strand` as a number (`1`/`-1`/`0`), attributes spread as lowercase
105
- top-level keys, and `subfeatures` instead of `child_features`.
36
+ top-level keys, single-valued attributes unwrapped from their array, and child
37
+ features nested under `subfeatures`. An attribute whose lowercased name collides
38
+ with a built-in field (e.g. `Start`, `Type`) is suffixed with `2` (`start2`,
39
+ `type2`).
106
40
 
107
- The same gene feature in JBrowse format:
41
+ A gene with an mRNA child:
108
42
 
109
43
  ```json
110
44
  {
@@ -114,44 +48,65 @@ The same gene feature in JBrowse format:
114
48
  "start": 999,
115
49
  "end": 9000,
116
50
  "strand": 1,
117
- "subfeatures": [],
118
51
  "id": "gene00001",
119
- "name": "EDEN"
52
+ "name": "EDEN",
53
+ "subfeatures": [
54
+ {
55
+ "refName": "ctg123",
56
+ "source": null,
57
+ "type": "mRNA",
58
+ "start": 1049,
59
+ "end": 9000,
60
+ "strand": 1,
61
+ "id": "mRNA00001",
62
+ "parent": "gene00001",
63
+ "subfeatures": []
64
+ }
65
+ ]
120
66
  }
121
67
  ```
122
68
 
123
- Note: multi-location features (same ID on multiple lines) are not merged in
124
- JBrowse format only the first occurrence is kept.
69
+ Multi-location features (the same ID on multiple lines, such as a CDS spanning
70
+ several segments) are not merged each line is its own flat feature, attached
71
+ to its parent (or kept as a top-level item) independently.
125
72
 
126
73
  ## API
127
74
 
128
- ### `parseStringSync(str: string): GFF3Feature[]`
75
+ ### `parseStringSync(str: string): GffFeature[]`
129
76
 
130
77
  Synchronously parse a GFF3 string and return an array of features. Comments,
131
78
  directives, and `##FASTA` sections are ignored.
132
79
 
133
- ### `parseStringSyncJBrowse(str: string): JBrowseFeature[]`
134
-
135
- Synchronously parse a GFF3 string and return features in JBrowse format.
80
+ ### `parseRecords<R>(records: readonly R[]): ParsedRecord<R>[]`
136
81
 
137
- ### `parseRecords(records: LineRecord[]): GFF3Feature[]`
82
+ Parse an array of records wrapping raw GFF3 lines. Useful when managing raw line
83
+ data directly (e.g. from a tabix-indexed file). Each top-level feature is
84
+ returned paired with the record it came from, so a caller can attach its own
85
+ stable id (a byte offset, a hash, …) without the parser stamping anything onto
86
+ the feature. Records may carry extra fields (`R` is inferred), which pass
87
+ through untouched on `record`.
138
88
 
139
- Parse an array of `LineRecord` objects. Useful when managing raw line data
140
- directly (e.g. from a tabix-indexed file with byte offsets).
89
+ ```ts
90
+ const features = parseRecords(
91
+ lines.map(line => ({ line, offset })),
92
+ ).map(({ feature, record }) => ({ ...feature, id: record.offset }))
93
+ ```
141
94
 
142
- ### `parseRecordsJBrowse(records: LineRecord[]): JBrowseFeature[]`
95
+ ### `extractType(line: string): string`
143
96
 
144
- Same as `parseRecords` but returns JBrowse-format features.
97
+ Extract the feature type (GFF3 column 3) from a raw line without fully splitting
98
+ it.
145
99
 
146
- ### `LineRecord`
100
+ ### `LineRecord` / `ParsedRecord`
147
101
 
148
102
  ```ts
149
103
  interface LineRecord {
150
104
  line: string
151
- hasEscapes: boolean // set true when line contains '%' to enable URL-decoding
152
- lineHash?: string | number // propagated to attributes._lineHash on the parsed feature
153
- start?: number // byte offset passthrough (not used by the parser)
154
- end?: number // byte offset passthrough (not used by the parser)
105
+ }
106
+
107
+ interface ParsedRecord<R extends LineRecord = LineRecord> {
108
+ feature: GffFeature
109
+ record: R // the input record this top-level feature was parsed from
155
110
  }
156
111
  ```
157
112
 
package/dist/api.d.ts CHANGED
@@ -1,48 +1,35 @@
1
- import type { GFF3Feature, JBrowseFeature } from './util.ts';
2
- interface ParseInput {
1
+ import type { GffFeature } from './util.ts';
2
+ export interface LineRecord {
3
+ /** Raw GFF3 feature line */
3
4
  line: string;
4
- lineHash?: string | number;
5
- hasEscapes: boolean;
6
5
  }
7
- export interface LineRecord extends ParseInput {
8
- /** Genomic start coordinate from the tabix index (1-based) */
9
- start: number;
10
- /** Genomic end coordinate from the tabix index */
11
- end: number;
12
- /** GFF3 feature type (column 3) */
13
- type: string;
6
+ /**
7
+ * A top-level parsed feature paired with the input record it came from. The
8
+ * parser stamps no identity onto the feature itself; callers that need a stable
9
+ * per-feature id (e.g. from a tabix byte offset) read it off their own `record`.
10
+ */
11
+ export interface ParsedRecord<R extends LineRecord = LineRecord> {
12
+ feature: GffFeature;
13
+ record: R;
14
14
  }
15
15
  /** Extract the GFF3 feature type (column 3) from a raw line without a full split. */
16
16
  export declare function extractType(line: string): string;
17
17
  /**
18
18
  * Synchronously parse a string containing GFF3 and return an array of the
19
- * parsed items.
20
- *
21
- * @param str - GFF3 string
22
- * @returns array of parsed features
23
- */
24
- export declare function parseStringSync(str: string): GFF3Feature[];
25
- /**
26
- * Synchronously parse a string containing GFF3 directly into JBrowse format.
19
+ * parsed features. Comments, directives, and `##FASTA` sections are ignored.
27
20
  *
28
21
  * @param str - GFF3 string
29
- * @returns array of JBrowse-format features
30
- */
31
- export declare function parseStringSyncJBrowse(str: string): JBrowseFeature[];
32
- /**
33
- * Parse an array of LineRecord objects containing raw GFF3 lines.
34
- * Supports parent/child relationships.
35
- *
36
- * @param records - Array of LineRecord objects with raw line and metadata
37
22
  * @returns array of parsed features
38
23
  */
39
- export declare function parseRecords(records: ParseInput[]): GFF3Feature[];
24
+ export declare function parseStringSync(str: string): GffFeature[];
40
25
  /**
41
- * Parse an array of LineRecord objects directly into JBrowse feature format.
42
- * Supports parent/child relationships via subfeatures.
26
+ * Parse an array of records wrapping raw GFF3 lines, resolving parent/child
27
+ * relationships into `subfeatures`. Returns each top-level feature paired with
28
+ * the record it came from, so callers can attach their own identity (e.g. a
29
+ * byte offset) without the parser stamping anything onto the feature.
43
30
  *
44
- * @param records - Array of LineRecord objects with raw line and metadata
45
- * @returns array of JBrowse-format features
31
+ * @param records - Array of records, each carrying a raw GFF3 `line`
32
+ * @returns top-level features, each paired with its originating record
46
33
  */
47
- export declare function parseRecordsJBrowse(records: ParseInput[]): JBrowseFeature[];
48
- export type { GFF3Comment, GFF3Directive, GFF3Feature, GFF3FeatureLine, GFF3FeatureLineWithRefs, GFF3Item, GFF3Sequence, JBrowseFeature, } from './util.ts';
34
+ export declare function parseRecords<R extends LineRecord>(records: readonly R[]): ParsedRecord<R>[];
35
+ export type { GffFeature } from './util.ts';
package/dist/api.js CHANGED
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractType = extractType;
4
4
  exports.parseStringSync = parseStringSync;
5
- exports.parseStringSyncJBrowse = parseStringSyncJBrowse;
6
5
  exports.parseRecords = parseRecords;
7
- exports.parseRecordsJBrowse = parseRecordsJBrowse;
8
6
  const util_ts_1 = require("./util.js");
9
7
  /** Extract the GFF3 feature type (column 3) from a raw line without a full split. */
10
8
  function extractType(line) {
@@ -24,8 +22,8 @@ function appendOrphan(orphans, key, value) {
24
22
  }
25
23
  }
26
24
  /**
27
- * The JBrowse parser collapses single-element attribute arrays to scalars, so a
28
- * raw ID/Parent value can be a string, a string array, or absent. These coerce
25
+ * The parser collapses single-element attribute arrays to scalars, so a raw
26
+ * ID/Parent value can be a string, a string array, or absent. These coerce
29
27
  * those `unknown` values without typecasts.
30
28
  */
31
29
  function firstString(value) {
@@ -39,174 +37,82 @@ function toStringArray(value) {
39
37
  return typeof value === 'string' ? [value] : [];
40
38
  }
41
39
  /**
42
- * Synchronously parse a string containing GFF3 and return an array of the
43
- * parsed items.
44
- *
45
- * @param str - GFF3 string
46
- * @returns array of parsed features
47
- */
48
- function parseStringSync(str) {
49
- return parseRecords(stringToRecords(str));
50
- }
51
- /**
52
- * Synchronously parse a string containing GFF3 directly into JBrowse format.
53
- *
54
- * @param str - GFF3 string
55
- * @returns array of JBrowse-format features
40
+ * Register a feature's ID and attach it to its parent(s), building the
41
+ * subfeature tree in `byId`/`orphans`. Returns true when the feature is
42
+ * top-level (has no Parent) and the caller should collect it.
56
43
  */
57
- function parseStringSyncJBrowse(str) {
58
- return parseRecordsJBrowse(stringToRecords(str));
59
- }
60
- function stringToRecords(str) {
61
- const lines = str.split(/\r?\n/);
62
- const records = [];
63
- for (const line of lines) {
64
- if (line.startsWith('##FASTA') || line.startsWith('>')) {
65
- break;
44
+ function linkFeature(feature, byId, orphans) {
45
+ const id = firstString(feature.id);
46
+ const parents = toStringArray(feature.parent);
47
+ // Register the id only the first time it is seen. Continuation lines
48
+ // (multi-location features such as a CDS spanning several segments share one
49
+ // ID across lines) skip registration but must still be attached to their
50
+ // parent below, so this is independent of the parent handling.
51
+ if (id && !byId.has(id)) {
52
+ byId.set(id, feature);
53
+ const waiting = orphans.get(id);
54
+ if (waiting) {
55
+ for (const w of waiting) {
56
+ feature.subfeatures.push(w);
57
+ }
58
+ orphans.delete(id);
66
59
  }
67
- if (line.length === 0 || line.startsWith('#')) {
68
- continue;
60
+ }
61
+ for (const parentId of parents) {
62
+ const parentFeature = byId.get(parentId);
63
+ if (parentFeature) {
64
+ parentFeature.subfeatures.push(feature);
65
+ }
66
+ else {
67
+ appendOrphan(orphans, parentId, feature);
69
68
  }
70
- records.push({
71
- line,
72
- hasEscapes: line.includes('%'),
73
- });
74
69
  }
75
- return records;
70
+ // Every line of a top-level discontinuous feature (e.g. cDNA_match spanning
71
+ // several segments under one shared ID, with no Parent) is its own top-level
72
+ // item, so this is independent of whether the id was just registered.
73
+ return parents.length === 0;
76
74
  }
77
75
  /**
78
- * Parse an array of LineRecord objects containing raw GFF3 lines.
79
- * Supports parent/child relationships.
76
+ * Synchronously parse a string containing GFF3 and return an array of the
77
+ * parsed features. Comments, directives, and `##FASTA` sections are ignored.
80
78
  *
81
- * @param records - Array of LineRecord objects with raw line and metadata
79
+ * @param str - GFF3 string
82
80
  * @returns array of parsed features
83
81
  */
84
- function parseRecords(records) {
82
+ function parseStringSync(str) {
85
83
  const items = [];
86
84
  const byId = new Map();
87
85
  const orphans = new Map();
88
- for (const record of records) {
89
- const parsed = record.hasEscapes
90
- ? (0, util_ts_1.parseFeature)(record.line)
91
- : (0, util_ts_1.parseFeatureNoUnescape)(record.line);
92
- const featureLine = {
93
- ...parsed,
94
- child_features: [],
95
- derived_features: [],
96
- };
97
- if (record.lineHash !== undefined) {
98
- featureLine.attributes ??= {};
99
- featureLine.attributes._lineHash = [String(record.lineHash)];
100
- }
101
- const attrs = featureLine.attributes;
102
- const ids = attrs?.ID;
103
- const parents = attrs?.Parent;
104
- if (!ids && !parents) {
105
- items.push([featureLine]);
86
+ for (const line of str.split(/\r?\n/)) {
87
+ if (line.startsWith('##FASTA') || line.startsWith('>')) {
88
+ break;
106
89
  }
107
- else {
108
- let feature;
109
- if (ids) {
110
- const id = ids[0];
111
- const existing = byId.get(id);
112
- if (existing) {
113
- // Multi-location continuation: share child_features/derived_features
114
- // with the first line so children remain visible across all lines
115
- // regardless of arrival order.
116
- featureLine.child_features = existing[0].child_features;
117
- featureLine.derived_features = existing[0].derived_features;
118
- existing.push(featureLine);
119
- feature = existing;
120
- }
121
- else {
122
- feature = [featureLine];
123
- if (!parents) {
124
- items.push(feature);
125
- }
126
- byId.set(id, feature);
127
- const waiting = orphans.get(id);
128
- if (waiting) {
129
- for (const w of waiting) {
130
- featureLine.child_features.push(w);
131
- }
132
- orphans.delete(id);
133
- }
134
- }
135
- }
136
- else {
137
- feature = [featureLine];
138
- }
139
- if (parents) {
140
- for (const parentId of parents) {
141
- const parent = byId.get(parentId);
142
- if (parent) {
143
- // child_features is shared across all parent feature lines,
144
- // so push once via the first line.
145
- parent[0].child_features.push(feature);
146
- }
147
- else {
148
- appendOrphan(orphans, parentId, feature);
149
- }
150
- }
90
+ if (line.length !== 0 && !line.startsWith('#')) {
91
+ const feature = (0, util_ts_1.parseFeature)(line);
92
+ if (linkFeature(feature, byId, orphans)) {
93
+ items.push(feature);
151
94
  }
152
95
  }
153
96
  }
154
97
  return items;
155
98
  }
156
99
  /**
157
- * Parse an array of LineRecord objects directly into JBrowse feature format.
158
- * Supports parent/child relationships via subfeatures.
100
+ * Parse an array of records wrapping raw GFF3 lines, resolving parent/child
101
+ * relationships into `subfeatures`. Returns each top-level feature paired with
102
+ * the record it came from, so callers can attach their own identity (e.g. a
103
+ * byte offset) without the parser stamping anything onto the feature.
159
104
  *
160
- * @param records - Array of LineRecord objects with raw line and metadata
161
- * @returns array of JBrowse-format features
105
+ * @param records - Array of records, each carrying a raw GFF3 `line`
106
+ * @returns top-level features, each paired with its originating record
162
107
  */
163
- function parseRecordsJBrowse(records) {
108
+ function parseRecords(records) {
164
109
  const items = [];
165
110
  const byId = new Map();
166
111
  const orphans = new Map();
167
112
  for (const record of records) {
168
- const feature = record.hasEscapes
169
- ? (0, util_ts_1.parseFeatureJBrowse)(record.line)
170
- : (0, util_ts_1.parseFeatureJBrowseNoUnescape)(record.line);
171
- if (record.lineHash !== undefined) {
172
- feature._lineHash = String(record.lineHash);
173
- }
174
- const id = firstString(feature.id);
175
- const parents = toStringArray(feature.parent);
176
- if (!id && parents.length === 0) {
177
- items.push(feature);
178
- }
179
- else {
180
- // A parentless line is a top-level item. Every line of a top-level
181
- // discontinuous feature (e.g. cDNA_match/EST_match spanning several
182
- // segments under one shared ID, with no Parent) is its own top-level
183
- // item, so push here regardless of whether the id is already registered.
184
- if (parents.length === 0) {
185
- items.push(feature);
186
- }
187
- // Register the id only the first time it is seen. Continuation lines
188
- // (multi-location features such as a CDS spanning several segments share
189
- // one ID across lines) skip registration but must still be attached to
190
- // their parent below, so this is independent of the parent handling.
191
- if (id && !byId.has(id)) {
192
- byId.set(id, feature);
193
- const waiting = orphans.get(id);
194
- if (waiting) {
195
- for (const w of waiting) {
196
- feature.subfeatures.push(w);
197
- }
198
- orphans.delete(id);
199
- }
200
- }
201
- for (const parentId of parents) {
202
- const parentFeature = byId.get(parentId);
203
- if (parentFeature) {
204
- parentFeature.subfeatures.push(feature);
205
- }
206
- else {
207
- appendOrphan(orphans, parentId, feature);
208
- }
209
- }
113
+ const feature = (0, util_ts_1.parseFeature)(record.line);
114
+ if (linkFeature(feature, byId, orphans)) {
115
+ items.push({ feature, record });
210
116
  }
211
117
  }
212
118
  return items;
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;AA6BA,kCAKC;AAoCD,0CAEC;AAQD,wDAEC;AA2BD,oCAyEC;AASD,kDAuDC;AAtPD,uCAKkB;AAuBlB,qFAAqF;AACrF,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IACrC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;AAC/B,CAAC;AAED,kFAAkF;AAClF,SAAS,YAAY,CAAI,OAAyB,EAAE,GAAW,EAAE,KAAQ;IACvE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC5B,IAAI,GAAG,EAAE,CAAC;QACR,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAC3B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,KAAc;IACjC,MAAM,CAAC,GAAY,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC1D,OAAO,OAAO,C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MAAK;QACP,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,IAAI,CAAC,CAAA;YAClC,IAAI,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;gBACxC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAC1B,OAAqB;IAErB,MAAM,KAAK,GAAsB,EAAE,CAAA;IACnC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAsB,CAAA;IAC1C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAA;IAE/C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;YACxC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { extractType, parseRecords, parseRecordsJBrowse, parseStringSync, parseStringSyncJBrowse, } from './api.ts';
2
- export type { GFF3Comment, GFF3Directive, GFF3Feature, GFF3FeatureLine, GFF3FeatureLineWithRefs, GFF3Item, GFF3Sequence, JBrowseFeature, LineRecord, } from './api.ts';
1
+ export { extractType, parseRecords, parseStringSync } from './api.ts';
2
+ export type { GffFeature, LineRecord, ParsedRecord } from './api.ts';
package/dist/index.js CHANGED
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseStringSyncJBrowse = exports.parseStringSync = exports.parseRecordsJBrowse = exports.parseRecords = exports.extractType = void 0;
3
+ exports.parseStringSync = exports.parseRecords = exports.extractType = void 0;
4
4
  var api_ts_1 = require("./api.js");
5
5
  Object.defineProperty(exports, "extractType", { enumerable: true, get: function () { return api_ts_1.extractType; } });
6
6
  Object.defineProperty(exports, "parseRecords", { enumerable: true, get: function () { return api_ts_1.parseRecords; } });
7
- Object.defineProperty(exports, "parseRecordsJBrowse", { enumerable: true, get: function () { return api_ts_1.parseRecordsJBrowse; } });
8
7
  Object.defineProperty(exports, "parseStringSync", { enumerable: true, get: function () { return api_ts_1.parseStringSync; } });
9
- Object.defineProperty(exports, "parseStringSyncJBrowse", { enumerable: true, get: function () { return api_ts_1.parseStringSyncJBrowse; } });
10
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAMiB;AALf,qGAAA,WAAW,OAAA;AACX,sGAAA,YAAY,OAAA;AACZ,6GAAA,mBAAmB,OAAA;AACnB,yGAAA,eAAe,OAAA;AACf,gHAAA,sBAAsB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqE;AAA5D,qGAAA,WAAW,OAAA;AAAE,sGAAA,YAAY,OAAA;AAAE,yGAAA,eAAe,OAAA"}