@gmod/bbi 1.0.30 → 1.0.31

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.
@@ -0,0 +1,323 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.BlockView = void 0;
7
+ const binary_parser_1 = require("@gmod/binary-parser");
8
+ const abortable_promise_cache_1 = __importDefault(require("abortable-promise-cache"));
9
+ const zlib_1 = __importDefault(require("zlib"));
10
+ const quick_lru_1 = __importDefault(require("quick-lru"));
11
+ const range_1 = __importDefault(require("./range"));
12
+ const util_1 = require("./util");
13
+ const BIG_WIG_TYPE_GRAPH = 1;
14
+ const BIG_WIG_TYPE_VSTEP = 2;
15
+ const BIG_WIG_TYPE_FSTEP = 3;
16
+ function getParsers(isBigEndian) {
17
+ const le = isBigEndian ? 'big' : 'little';
18
+ const summaryParser = new binary_parser_1.Parser()
19
+ .endianess(le)
20
+ .uint32('chromId')
21
+ .uint32('start')
22
+ .uint32('end')
23
+ .uint32('validCnt')
24
+ .float('minScore')
25
+ .float('maxScore')
26
+ .float('sumData')
27
+ .float('sumSqData');
28
+ const leafParser = new binary_parser_1.Parser()
29
+ .endianess(le)
30
+ .uint8('isLeaf')
31
+ .skip(1)
32
+ .uint16('cnt')
33
+ .choice({
34
+ tag: 'isLeaf',
35
+ choices: {
36
+ 1: new binary_parser_1.Parser().array('blocksToFetch', {
37
+ length: 'cnt',
38
+ type: new binary_parser_1.Parser()
39
+ .uint32('startChrom')
40
+ .uint32('startBase')
41
+ .uint32('endChrom')
42
+ .uint32('endBase')
43
+ .uint64('blockOffset')
44
+ .uint64('blockSize'),
45
+ }),
46
+ 0: new binary_parser_1.Parser().array('recurOffsets', {
47
+ length: 'cnt',
48
+ type: new binary_parser_1.Parser()
49
+ .uint32('startChrom')
50
+ .uint32('startBase')
51
+ .uint32('endChrom')
52
+ .uint32('endBase')
53
+ .uint64('blockOffset'),
54
+ }),
55
+ },
56
+ });
57
+ const bigBedParser = new binary_parser_1.Parser()
58
+ .endianess(le)
59
+ .uint32('chromId')
60
+ .int32('start')
61
+ .int32('end')
62
+ .string('rest', {
63
+ zeroTerminated: true,
64
+ });
65
+ const bigWigParser = new binary_parser_1.Parser()
66
+ .endianess(le)
67
+ .skip(4)
68
+ .int32('blockStart')
69
+ .skip(4)
70
+ .uint32('itemStep')
71
+ .uint32('itemSpan')
72
+ .uint8('blockType')
73
+ .skip(1)
74
+ .uint16('itemCount')
75
+ .choice({
76
+ tag: 'blockType',
77
+ choices: {
78
+ [BIG_WIG_TYPE_FSTEP]: new binary_parser_1.Parser().array('items', {
79
+ length: 'itemCount',
80
+ type: new binary_parser_1.Parser().float('score'),
81
+ }),
82
+ [BIG_WIG_TYPE_VSTEP]: new binary_parser_1.Parser().array('items', {
83
+ length: 'itemCount',
84
+ type: new binary_parser_1.Parser().int32('start').float('score'),
85
+ }),
86
+ [BIG_WIG_TYPE_GRAPH]: new binary_parser_1.Parser().array('items', {
87
+ length: 'itemCount',
88
+ type: new binary_parser_1.Parser().int32('start').int32('end').float('score'),
89
+ }),
90
+ },
91
+ });
92
+ return {
93
+ bigWigParser,
94
+ bigBedParser,
95
+ summaryParser,
96
+ leafParser,
97
+ };
98
+ }
99
+ /**
100
+ * View into a subset of the data in a BigWig file.
101
+ *
102
+ * Adapted by Robert Buels and Colin Diesh from bigwig.js in the Dalliance Genome
103
+ * Explorer by Thomas Down.
104
+ * @constructs
105
+ */
106
+ class BlockView {
107
+ constructor(bbi, refsByName, cirTreeOffset, cirTreeLength, isBigEndian, isCompressed, blockType) {
108
+ this.featureCache = new abortable_promise_cache_1.default({
109
+ cache: new quick_lru_1.default({ maxSize: 1000 }),
110
+ fill: async (requestData, signal) => {
111
+ const { length, offset } = requestData;
112
+ const { buffer } = await this.bbi.read(Buffer.alloc(length), 0, length, offset, { signal });
113
+ return buffer;
114
+ },
115
+ });
116
+ if (!(cirTreeOffset >= 0)) {
117
+ throw new Error('invalid cirTreeOffset!');
118
+ }
119
+ if (!(cirTreeLength > 0)) {
120
+ throw new Error('invalid cirTreeLength!');
121
+ }
122
+ this.cirTreeOffset = cirTreeOffset;
123
+ this.cirTreeLength = cirTreeLength;
124
+ this.isCompressed = isCompressed;
125
+ this.refsByName = refsByName;
126
+ this.isBigEndian = isBigEndian;
127
+ this.bbi = bbi;
128
+ this.blockType = blockType;
129
+ Object.assign(this, getParsers(isBigEndian));
130
+ }
131
+ async readWigData(chrName, start, end, observer, opts) {
132
+ try {
133
+ const { refsByName, bbi, cirTreeOffset, isBigEndian } = this;
134
+ const { signal } = opts;
135
+ const chrId = refsByName[chrName];
136
+ if (chrId === undefined) {
137
+ observer.complete();
138
+ }
139
+ const request = { chrId, start, end };
140
+ if (!this.cirTreePromise) {
141
+ this.cirTreePromise = bbi.read(Buffer.alloc(48), 0, 48, cirTreeOffset, {
142
+ signal,
143
+ });
144
+ }
145
+ const { buffer } = await this.cirTreePromise;
146
+ const cirBlockSize = isBigEndian
147
+ ? buffer.readUInt32BE(4)
148
+ : buffer.readUInt32LE(4);
149
+ let blocksToFetch = [];
150
+ let outstanding = 0;
151
+ //eslint-disable-next-line prefer-const
152
+ let cirFobRecur2;
153
+ const filterFeats = (b) => (b.startChrom < chrId ||
154
+ (b.startChrom === chrId && b.startBase <= end)) &&
155
+ (b.endChrom > chrId || (b.endChrom === chrId && b.endBase >= start));
156
+ const cirFobStartFetch = async (off, fr, level) => {
157
+ try {
158
+ const length = fr.max() - fr.min();
159
+ const offset = fr.min();
160
+ const resultBuffer = await this.featureCache.get(`${length}_${offset}`, { length, offset }, signal);
161
+ for (let i = 0; i < off.length; i += 1) {
162
+ if (fr.contains(off[i])) {
163
+ cirFobRecur2(resultBuffer, off[i] - offset, level, observer, opts);
164
+ outstanding -= 1;
165
+ if (outstanding === 0) {
166
+ this.readFeatures(observer, blocksToFetch, { ...opts, request });
167
+ }
168
+ }
169
+ }
170
+ }
171
+ catch (e) {
172
+ observer.error(e);
173
+ }
174
+ };
175
+ const cirFobRecur = (offset, level) => {
176
+ try {
177
+ outstanding += offset.length;
178
+ const maxCirBlockSpan = 4 + cirBlockSize * 32; // Upper bound on size, based on a completely full leaf node.
179
+ let spans = new range_1.default(offset[0], offset[0] + maxCirBlockSpan);
180
+ for (let i = 1; i < offset.length; i += 1) {
181
+ const blockSpan = new range_1.default(offset[i], offset[i] + maxCirBlockSpan);
182
+ spans = spans.union(blockSpan);
183
+ }
184
+ spans
185
+ .getRanges()
186
+ .map((fr) => cirFobStartFetch(offset, fr, level));
187
+ }
188
+ catch (e) {
189
+ observer.error(e);
190
+ }
191
+ };
192
+ cirFobRecur2 = (cirBlockData, offset, level) => {
193
+ try {
194
+ const data = cirBlockData.slice(offset);
195
+ const p = this.leafParser.parse(data).result;
196
+ if (p.blocksToFetch) {
197
+ blocksToFetch = blocksToFetch.concat(p.blocksToFetch.filter(filterFeats).map((l) => ({
198
+ offset: l.blockOffset,
199
+ length: l.blockSize,
200
+ })));
201
+ }
202
+ if (p.recurOffsets) {
203
+ const recurOffsets = p.recurOffsets
204
+ .filter(filterFeats)
205
+ .map((l) => l.blockOffset);
206
+ if (recurOffsets.length > 0) {
207
+ cirFobRecur(recurOffsets, level + 1);
208
+ }
209
+ }
210
+ }
211
+ catch (e) {
212
+ observer.error(e);
213
+ }
214
+ };
215
+ return cirFobRecur([cirTreeOffset + 48], 1);
216
+ }
217
+ catch (e) {
218
+ observer.error(e);
219
+ }
220
+ }
221
+ parseSummaryBlock(data, startOffset, request) {
222
+ const features = [];
223
+ let currOffset = startOffset;
224
+ while (currOffset < data.byteLength) {
225
+ const res = this.summaryParser.parse(data.slice(currOffset));
226
+ features.push(res.result);
227
+ currOffset += res.offset;
228
+ }
229
+ let items = features;
230
+ if (request) {
231
+ items = items.filter((elt) => elt.chromId === request.chrId);
232
+ }
233
+ items = items.map((elt) => ({
234
+ start: elt.start,
235
+ end: elt.end,
236
+ maxScore: elt.maxScore,
237
+ minScore: elt.minScore,
238
+ score: elt.sumData / (elt.validCnt || 1),
239
+ summary: true,
240
+ }));
241
+ return request
242
+ ? items.filter(f => BlockView.coordFilter(f, request))
243
+ : items;
244
+ }
245
+ parseBigBedBlock(data, startOffset, offset, request) {
246
+ const items = [];
247
+ let currOffset = startOffset;
248
+ while (currOffset < data.byteLength) {
249
+ const res = this.bigBedParser.parse(data.slice(currOffset));
250
+ res.result.uniqueId = `bb-${offset + currOffset}`;
251
+ items.push(res.result);
252
+ currOffset += res.offset;
253
+ }
254
+ return request
255
+ ? items.filter((f) => BlockView.coordFilter(f, request))
256
+ : items;
257
+ }
258
+ parseBigWigBlock(bytes, startOffset, request) {
259
+ const data = bytes.slice(startOffset);
260
+ const results = this.bigWigParser.parse(data).result;
261
+ const { items, itemSpan, itemStep, blockStart, blockType } = results;
262
+ if (blockType === BIG_WIG_TYPE_FSTEP) {
263
+ for (let i = 0; i < items.length; i++) {
264
+ items[i].start = blockStart + i * itemStep;
265
+ items[i].end = blockStart + i * itemStep + itemSpan;
266
+ }
267
+ }
268
+ else if (blockType === BIG_WIG_TYPE_VSTEP) {
269
+ for (let i = 0; i < items.length; i++) {
270
+ items[i].end = items[i].start + itemSpan;
271
+ }
272
+ }
273
+ return request
274
+ ? items.filter((f) => BlockView.coordFilter(f, request))
275
+ : items;
276
+ }
277
+ static coordFilter(f, range) {
278
+ return f.start < range.end && f.end >= range.start;
279
+ }
280
+ async readFeatures(observer, blocks, opts = {}) {
281
+ try {
282
+ const { blockType, isCompressed } = this;
283
+ const { signal, request } = opts;
284
+ const blockGroupsToFetch = (0, util_1.groupBlocks)(blocks);
285
+ (0, util_1.checkAbortSignal)(signal);
286
+ await Promise.all(blockGroupsToFetch.map(async (blockGroup) => {
287
+ (0, util_1.checkAbortSignal)(signal);
288
+ const { length, offset } = blockGroup;
289
+ const data = await this.featureCache.get(`${length}_${offset}`, blockGroup, signal);
290
+ blockGroup.blocks.forEach((block) => {
291
+ (0, util_1.checkAbortSignal)(signal);
292
+ let blockOffset = block.offset - blockGroup.offset;
293
+ let resultData = data;
294
+ if (isCompressed) {
295
+ resultData = zlib_1.default.inflateSync(data.slice(blockOffset));
296
+ blockOffset = 0;
297
+ }
298
+ (0, util_1.checkAbortSignal)(signal);
299
+ switch (blockType) {
300
+ case 'summary':
301
+ observer.next(this.parseSummaryBlock(resultData, blockOffset, request));
302
+ break;
303
+ case 'bigwig':
304
+ observer.next(this.parseBigWigBlock(resultData, blockOffset, request));
305
+ break;
306
+ case 'bigbed':
307
+ observer.next(this.parseBigBedBlock(resultData, blockOffset,
308
+ // eslint-disable-next-line no-bitwise
309
+ block.offset * (1 << 8), request));
310
+ break;
311
+ default:
312
+ console.warn(`Don't know what to do with ${blockType}`);
313
+ }
314
+ });
315
+ }));
316
+ observer.complete();
317
+ }
318
+ catch (e) {
319
+ observer.error(e);
320
+ }
321
+ }
322
+ }
323
+ exports.BlockView = BlockView;
package/esm/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { BigWig } from './bigwig';
2
+ export { BigBed } from './bigbed';
3
+ export { Feature, Header, RequestOptions } from './bbi';
package/esm/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BigBed = exports.BigWig = void 0;
4
+ var bigwig_1 = require("./bigwig");
5
+ Object.defineProperty(exports, "BigWig", { enumerable: true, get: function () { return bigwig_1.BigWig; } });
6
+ var bigbed_1 = require("./bigbed");
7
+ Object.defineProperty(exports, "BigBed", { enumerable: true, get: function () { return bigbed_1.BigBed; } });
package/esm/range.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Adapted from a combination of Range and _Compound in the
3
+ * Dalliance Genome Explorer, (c) Thomas Down 2006-2010.
4
+ */
5
+ export default class Range {
6
+ ranges: any;
7
+ constructor(arg1: any, arg2?: any);
8
+ min(): number;
9
+ max(): number;
10
+ contains(pos: number): boolean;
11
+ isContiguous(): boolean;
12
+ getRanges(): Range[];
13
+ toString(): string;
14
+ union(s1: Range): Range;
15
+ intersection(arg: Range): Range;
16
+ coverage(): number;
17
+ rangeOrder(tmpa: Range, tmpb: Range): number;
18
+ }
package/esm/range.js ADDED
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ /* eslint prefer-rest-params:0, no-nested-ternary:0 */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Adapted from a combination of Range and _Compound in the
6
+ * Dalliance Genome Explorer, (c) Thomas Down 2006-2010.
7
+ */
8
+ class Range {
9
+ constructor(arg1, arg2) {
10
+ this.ranges =
11
+ arguments.length === 2
12
+ ? [{ min: arg1, max: arg2 }]
13
+ : 0 in arg1
14
+ ? Object.assign({}, arg1)
15
+ : [arg1];
16
+ }
17
+ min() {
18
+ return this.ranges[0].min;
19
+ }
20
+ max() {
21
+ return this.ranges[this.ranges.length - 1].max;
22
+ }
23
+ contains(pos) {
24
+ for (let s = 0; s < this.ranges.length; s += 1) {
25
+ const r = this.ranges[s];
26
+ if (r.min <= pos && r.max >= pos) {
27
+ return true;
28
+ }
29
+ }
30
+ return false;
31
+ }
32
+ isContiguous() {
33
+ return this.ranges.length > 1;
34
+ }
35
+ getRanges() {
36
+ return this.ranges.map((r) => new Range(r.min, r.max));
37
+ }
38
+ toString() {
39
+ return this.ranges.map((r) => `[${r.min}-${r.max}]`).join(',');
40
+ }
41
+ union(s1) {
42
+ const ranges = this.getRanges().concat(s1.getRanges()).sort(this.rangeOrder);
43
+ const oranges = [];
44
+ let current = ranges[0];
45
+ for (let i = 1; i < ranges.length; i += 1) {
46
+ const nxt = ranges[i];
47
+ if (nxt.min() > current.max() + 1) {
48
+ oranges.push(current);
49
+ current = nxt;
50
+ }
51
+ else if (nxt.max() > current.max()) {
52
+ current = new Range(current.min(), nxt.max());
53
+ }
54
+ }
55
+ oranges.push(current);
56
+ if (oranges.length === 1) {
57
+ return oranges[0];
58
+ }
59
+ return new Range(oranges);
60
+ }
61
+ intersection(arg) {
62
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
63
+ let s0 = this;
64
+ let s1 = arg;
65
+ const r0 = this.ranges();
66
+ const r1 = s1.ranges();
67
+ const l0 = r0.length;
68
+ const l1 = r1.length;
69
+ let i0 = 0;
70
+ let i1 = 0;
71
+ const or = [];
72
+ while (i0 < l0 && i1 < l1) {
73
+ s0 = r0[i0];
74
+ s1 = r1[i1];
75
+ const lapMin = Math.max(s0.min(), s1.min());
76
+ const lapMax = Math.min(s0.max(), s1.max());
77
+ if (lapMax >= lapMin) {
78
+ or.push(new Range(lapMin, lapMax));
79
+ }
80
+ if (s0.max() > s1.max()) {
81
+ i1 += 1;
82
+ }
83
+ else {
84
+ i0 += 1;
85
+ }
86
+ }
87
+ if (or.length === 0) {
88
+ throw new Error('found range of length 0');
89
+ }
90
+ if (or.length === 1) {
91
+ return or[0];
92
+ }
93
+ return new Range(or);
94
+ }
95
+ coverage() {
96
+ let tot = 0;
97
+ const rl = this.ranges();
98
+ for (let ri = 0; ri < rl.length; ri += 1) {
99
+ const r = rl[ri];
100
+ tot += r.max() - r.min() + 1;
101
+ }
102
+ return tot;
103
+ }
104
+ rangeOrder(tmpa, tmpb) {
105
+ let a = tmpa;
106
+ let b = tmpb;
107
+ if (arguments.length < 2) {
108
+ b = a;
109
+ a = this;
110
+ }
111
+ if (a.min() < b.min()) {
112
+ return -1;
113
+ }
114
+ if (a.min() > b.min()) {
115
+ return 1;
116
+ }
117
+ if (a.max() < b.max()) {
118
+ return -1;
119
+ }
120
+ if (b.max() > a.max()) {
121
+ return 1;
122
+ }
123
+ return 0;
124
+ }
125
+ }
126
+ exports.default = Range;
package/esm/util.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ export declare class AbortError extends Error {
2
+ code: string;
3
+ constructor(message: string);
4
+ }
5
+ export declare function groupBlocks(blocks: any[]): any[];
6
+ /**
7
+ * Properly check if the given AbortSignal is aborted.
8
+ * Per the standard, if the signal reads as aborted,
9
+ * this function throws either a DOMException AbortError, or a regular error
10
+ * with a `code` attribute set to `ERR_ABORTED`.
11
+ *
12
+ * For convenience, passing `undefined` is a no-op
13
+ *
14
+ * @param {AbortSignal} [signal] an AbortSignal, or anything with an `aborted` attribute
15
+ * @returns nothing
16
+ */
17
+ export declare function checkAbortSignal(signal?: AbortSignal): void;
18
+ /**
19
+ * Skips to the next tick, then runs `checkAbortSignal`.
20
+ * Await this to inside an otherwise synchronous loop to
21
+ * provide a place to break when an abort signal is received.
22
+ * @param {AbortSignal} signal
23
+ */
24
+ export declare function abortBreakPoint(signal?: AbortSignal): Promise<void>;
package/esm/util.js ADDED
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.abortBreakPoint = exports.checkAbortSignal = exports.groupBlocks = exports.AbortError = void 0;
4
+ /* eslint no-bitwise: ["error", { "allow": ["|"] }] */
5
+ class AbortError extends Error {
6
+ constructor(message) {
7
+ super(message);
8
+ this.code = 'ERR_ABORTED';
9
+ }
10
+ }
11
+ exports.AbortError = AbortError;
12
+ // sort blocks by file offset and
13
+ // group blocks that are within 2KB of eachother
14
+ function groupBlocks(blocks) {
15
+ blocks.sort((b0, b1) => (b0.offset | 0) - (b1.offset | 0));
16
+ const blockGroups = [];
17
+ let lastBlock;
18
+ let lastBlockEnd;
19
+ for (let i = 0; i < blocks.length; i += 1) {
20
+ if (lastBlock && blocks[i].offset - lastBlockEnd <= 2000) {
21
+ lastBlock.length += blocks[i].length - lastBlockEnd + blocks[i].offset;
22
+ lastBlock.blocks.push(blocks[i]);
23
+ }
24
+ else {
25
+ blockGroups.push((lastBlock = {
26
+ blocks: [blocks[i]],
27
+ length: blocks[i].length,
28
+ offset: blocks[i].offset,
29
+ }));
30
+ }
31
+ lastBlockEnd = lastBlock.offset + lastBlock.length;
32
+ }
33
+ return blockGroups;
34
+ }
35
+ exports.groupBlocks = groupBlocks;
36
+ /**
37
+ * Properly check if the given AbortSignal is aborted.
38
+ * Per the standard, if the signal reads as aborted,
39
+ * this function throws either a DOMException AbortError, or a regular error
40
+ * with a `code` attribute set to `ERR_ABORTED`.
41
+ *
42
+ * For convenience, passing `undefined` is a no-op
43
+ *
44
+ * @param {AbortSignal} [signal] an AbortSignal, or anything with an `aborted` attribute
45
+ * @returns nothing
46
+ */
47
+ function checkAbortSignal(signal) {
48
+ if (!signal) {
49
+ return;
50
+ }
51
+ if (signal.aborted) {
52
+ // console.log('bam aborted!')
53
+ if (typeof DOMException !== 'undefined') {
54
+ throw new DOMException('aborted', 'AbortError');
55
+ }
56
+ else {
57
+ const e = new AbortError('aborted');
58
+ e.code = 'ERR_ABORTED';
59
+ throw e;
60
+ }
61
+ }
62
+ }
63
+ exports.checkAbortSignal = checkAbortSignal;
64
+ /**
65
+ * Skips to the next tick, then runs `checkAbortSignal`.
66
+ * Await this to inside an otherwise synchronous loop to
67
+ * provide a place to break when an abort signal is received.
68
+ * @param {AbortSignal} signal
69
+ */
70
+ async function abortBreakPoint(signal) {
71
+ await Promise.resolve();
72
+ checkAbortSignal(signal);
73
+ }
74
+ exports.abortBreakPoint = abortBreakPoint;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@gmod/bbi",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Parser for BigWig/BigBed files",
5
5
  "license": "MIT",
6
6
  "repository": "GMOD/bbi-js",
7
7
  "main": "dist/index.js",
8
+ "module": "esm/index.js",
8
9
  "author": {
9
10
  "name": "Colin Diesh",
10
11
  "email": "colin.diesh@gmail.com",
@@ -14,17 +15,16 @@
14
15
  "node": ">=6"
15
16
  },
16
17
  "files": [
17
- "dist"
18
+ "dist",
19
+ "esm"
18
20
  ],
19
21
  "scripts": {
20
22
  "test": "jest",
21
23
  "coverage": "npm test -- --coverage",
22
24
  "lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts src",
23
- "clean": "rimraf dist",
25
+ "clean": "rimraf dist esm",
24
26
  "prebuild": "npm run clean",
25
- "build:types": "tsc --emitDeclarationOnly",
26
- "build:js": "babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps inline",
27
- "build": "npm run build:types && npm run build:js",
27
+ "build": "tsc --target es2018 --outDir esm && tsc --target es5 --outDir dist",
28
28
  "preversion": "npm run lint && npm test && npm run build",
29
29
  "version": "standard-changelog && git add CHANGELOG.md",
30
30
  "postpublish": "git push origin master --follow-tags"
@@ -38,9 +38,8 @@
38
38
  "genomics"
39
39
  ],
40
40
  "dependencies": {
41
- "@babel/runtime": "^7.4.4",
42
- "@gmod/binary-parser": "^1.3.5",
43
- "abortable-promise-cache": "^1.0.1",
41
+ "@gmod/binary-parser": "^1.4.0",
42
+ "abortable-promise-cache": "^1.4.1",
44
43
  "buffer-crc32": "^0.2.13",
45
44
  "es6-promisify": "^6.0.1",
46
45
  "generic-filehandle": "^2.0.0",
@@ -48,32 +47,23 @@
48
47
  "rxjs": "^6.5.2"
49
48
  },
50
49
  "devDependencies": {
51
- "@babel/cli": "^7.4.4",
52
- "@babel/core": "^7.4.4",
53
- "@babel/plugin-proposal-class-properties": "^7.4.4",
54
- "@babel/plugin-transform-runtime": "^7.4.4",
55
- "@babel/preset-env": "^7.4.4",
56
- "@babel/preset-typescript": "^7.3.3",
57
50
  "@gmod/bed": "^2.0.0",
58
- "@types/jest": "^24.0.13",
51
+ "@types/jest": "^27.0.3",
59
52
  "@types/long": "^4.0.0",
60
53
  "@types/node": "^12.0.2",
61
54
  "@typescript-eslint/eslint-plugin": "^2.0.0",
62
55
  "@typescript-eslint/parser": "^2.0.0",
63
- "babel-eslint": "^10.0.1",
64
- "babel-preset-typescript": "^7.0.0-alpha.19",
65
56
  "cross-fetch": "^3.0.2",
66
- "eslint": "^5.16.0",
67
- "eslint-config-airbnb-base": "^13.1.0",
68
- "eslint-config-prettier": "^4.2.0",
69
- "eslint-plugin-import": "^2.17.2",
70
- "eslint-plugin-jest": "^22.5.1",
71
- "eslint-plugin-prettier": "^3.1.0",
72
- "jest": "^24.8.0",
73
- "prettier": "^1.17.1",
57
+ "eslint": "^7.0.0",
58
+ "eslint-config-prettier": "^8.3.0",
59
+ "eslint-plugin-import": "^2.25.3",
60
+ "eslint-plugin-prettier": "^4.0.0",
61
+ "jest": "^27.4.3",
62
+ "prettier": "^2.5.1",
74
63
  "rimraf": "^2.6.3",
75
64
  "standard-changelog": "^2.0.11",
76
- "typescript": "^3.4.5"
65
+ "ts-jest": "^27.0.7",
66
+ "typescript": "^4.5.2"
77
67
  },
78
68
  "publishConfig": {
79
69
  "access": "public"
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbXX0=