Comparing version 5.0.1 to 5.0.2
@@ -0,1 +1,5 @@ | ||
## [5.0.2](https://github.com/GMOD/bbi-js/compare/v5.0.1...v5.0.2) (2024-09-03) | ||
## [5.0.1](https://github.com/GMOD/bbi-js/compare/v5.0.0...v5.0.1) (2024-08-09) | ||
@@ -2,0 +6,0 @@ |
@@ -23,3 +23,3 @@ "use strict"; | ||
if (!this.headerP) { | ||
this.headerP = this._getHeader(opts).catch(e => { | ||
this.headerP = this._getHeader(opts).catch((e) => { | ||
this.headerP = undefined; | ||
@@ -283,3 +283,5 @@ throw e; | ||
.readWigData(chrName, start, end, observer, opts) | ||
.catch(e => observer.error(e)); | ||
.catch((e) => { | ||
observer.error(e); | ||
}); | ||
}); | ||
@@ -286,0 +288,0 @@ }); |
@@ -215,3 +215,5 @@ "use strict"; | ||
return new rxjs_1.Observable(observer => { | ||
view.readFeatures(observer, [block], opts).catch(e => observer.error(e)); | ||
view.readFeatures(observer, [block], opts).catch((e) => { | ||
observer.error(e); | ||
}); | ||
}).pipe((0, operators_1.reduce)((acc, curr) => acc.concat(curr)), (0, operators_1.map)(x => { | ||
@@ -218,0 +220,0 @@ for (const element of x) { |
@@ -31,2 +31,3 @@ "use strict"; | ||
const zh = zoomLevels[i]; | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
if (zh && zh.reductionLevel <= 2 * basesPerPx) { | ||
@@ -33,0 +34,0 @@ return new block_view_1.BlockView(this.bbi, refsByName, zh.indexOffset, isBigEndian, uncompressBufSize > 0, 'summary'); |
@@ -23,2 +23,3 @@ "use strict"; | ||
const util_1 = require("./util"); | ||
const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined; | ||
function coordFilter(s1, e1, s2, e2) { | ||
@@ -167,3 +168,5 @@ return s1 < e2 && e1 >= s2; | ||
if (outstanding === 0) { | ||
this.readFeatures(observer, blocksToFetch, Object.assign(Object.assign({}, opts), { request })).catch(e => observer.error(e)); | ||
this.readFeatures(observer, blocksToFetch, Object.assign(Object.assign({}, opts), { request })).catch((e) => { | ||
observer.error(e); | ||
}); | ||
} | ||
@@ -204,3 +207,4 @@ } | ||
}; | ||
return cirFobRecur([Number(cirTreeOffset) + 48], 1); | ||
cirFobRecur([Number(cirTreeOffset) + 48], 1); | ||
return; | ||
} | ||
@@ -253,2 +257,3 @@ catch (e) { | ||
parseBigBedBlock(data, startOffset, offset, request) { | ||
var _a; | ||
const items = []; | ||
@@ -273,3 +278,4 @@ let currOffset = startOffset; | ||
} | ||
const rest = data.subarray(currOffset, i).toString(); | ||
const b = data.subarray(currOffset, i); | ||
const rest = (_a = decoder === null || decoder === void 0 ? void 0 : decoder.decode(b)) !== null && _a !== void 0 ? _a : b.toString(); | ||
currOffset = i + 1; | ||
@@ -276,0 +282,0 @@ items.push({ |
@@ -11,3 +11,3 @@ import { Buffer } from 'buffer'; | ||
if (!this.headerP) { | ||
this.headerP = this._getHeader(opts).catch(e => { | ||
this.headerP = this._getHeader(opts).catch((e) => { | ||
this.headerP = undefined; | ||
@@ -262,3 +262,5 @@ throw e; | ||
.readWigData(chrName, start, end, observer, opts) | ||
.catch(e => observer.error(e)); | ||
.catch((e) => { | ||
observer.error(e); | ||
}); | ||
}); | ||
@@ -265,0 +267,0 @@ } |
@@ -181,3 +181,5 @@ import { Buffer } from 'buffer'; | ||
return new Observable(observer => { | ||
view.readFeatures(observer, [block], opts).catch(e => observer.error(e)); | ||
view.readFeatures(observer, [block], opts).catch((e) => { | ||
observer.error(e); | ||
}); | ||
}).pipe(reduce((acc, curr) => acc.concat(curr)), map(x => { | ||
@@ -184,0 +186,0 @@ for (const element of x) { |
@@ -18,2 +18,3 @@ import { BlockView } from './block-view'; | ||
const zh = zoomLevels[i]; | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
if (zh && zh.reductionLevel <= 2 * basesPerPx) { | ||
@@ -20,0 +21,0 @@ return new BlockView(this.bbi, refsByName, zh.indexOffset, isBigEndian, uncompressBufSize > 0, 'summary'); |
@@ -8,2 +8,3 @@ import { Buffer } from 'buffer'; | ||
import { groupBlocks, checkAbortSignal } from './util'; | ||
const decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined; | ||
function coordFilter(s1, e1, s2, e2) { | ||
@@ -154,3 +155,5 @@ return s1 < e2 && e1 >= s2; | ||
request, | ||
}).catch(e => observer.error(e)); | ||
}).catch((e) => { | ||
observer.error(e); | ||
}); | ||
} | ||
@@ -191,3 +194,4 @@ } | ||
}; | ||
return cirFobRecur([Number(cirTreeOffset) + 48], 1); | ||
cirFobRecur([Number(cirTreeOffset) + 48], 1); | ||
return; | ||
} | ||
@@ -239,2 +243,3 @@ catch (e) { | ||
parseBigBedBlock(data, startOffset, offset, request) { | ||
var _a; | ||
const items = []; | ||
@@ -259,3 +264,4 @@ let currOffset = startOffset; | ||
} | ||
const rest = data.subarray(currOffset, i).toString(); | ||
const b = data.subarray(currOffset, i); | ||
const rest = (_a = decoder === null || decoder === void 0 ? void 0 : decoder.decode(b)) !== null && _a !== void 0 ? _a : b.toString(); | ||
currOffset = i + 1; | ||
@@ -262,0 +268,0 @@ items.push({ |
{ | ||
"name": "@gmod/bbi", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Parser for BigWig/BigBed files", | ||
@@ -23,4 +23,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "jest", | ||
"coverage": "npm test -- --coverage", | ||
"test": "vitest", | ||
"lint": "eslint --report-unused-disable-directives --max-warnings 0 src", | ||
@@ -33,3 +32,3 @@ "format": "prettier", | ||
"build": "npm run build:esm && npm run build:es5", | ||
"preversion": "npm run lint && npm test && npm run build", | ||
"preversion": "npm run lint && npm test run && npm run build", | ||
"version": "standard-changelog && git add CHANGELOG.md", | ||
@@ -48,2 +47,3 @@ "postversion": "git push origin master --follow-tags" | ||
"@gmod/abortable-promise-cache": "^2.0.0", | ||
"buffer": "^6.0.3", | ||
"generic-filehandle": "^3.0.0", | ||
@@ -59,15 +59,13 @@ "pako": "^2.0.0", | ||
"@types/pako": "^2.0.0", | ||
"@typescript-eslint/eslint-plugin": "^8.0.1", | ||
"@typescript-eslint/parser": "^8.0.1", | ||
"eslint": "^9.0.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"@typescript-eslint/eslint-plugin": "^8.4.0", | ||
"@typescript-eslint/parser": "^8.4.0", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"eslint": "^9.9.1", | ||
"eslint-plugin-unicorn": "^55.0.0", | ||
"jest": "^29.6.2", | ||
"jest-environment-jsdom": "^29.6.2", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^6.0.1", | ||
"standard-changelog": "^6.0.0", | ||
"ts-jest": "^29.1.2", | ||
"typescript": "^5.1.6" | ||
"typescript": "^5.1.6", | ||
"typescript-eslint": "^8.4.0", | ||
"vitest": "^2.0.5" | ||
}, | ||
@@ -74,0 +72,0 @@ "publishConfig": { |
@@ -83,3 +83,3 @@ import { Buffer } from 'buffer' | ||
if (!this.headerP) { | ||
this.headerP = this._getHeader(opts).catch(e => { | ||
this.headerP = this._getHeader(opts).catch((e: unknown) => { | ||
this.headerP = undefined | ||
@@ -399,3 +399,5 @@ throw e | ||
.readWigData(chrName, start, end, observer, opts) | ||
.catch(e => observer.error(e)) | ||
.catch((e: unknown) => { | ||
observer.error(e) | ||
}) | ||
}) | ||
@@ -402,0 +404,0 @@ } |
@@ -235,3 +235,5 @@ import { Buffer } from 'buffer' | ||
return new Observable<Feature[]>(observer => { | ||
view.readFeatures(observer, [block], opts).catch(e => observer.error(e)) | ||
view.readFeatures(observer, [block], opts).catch((e: unknown) => { | ||
observer.error(e) | ||
}) | ||
}).pipe( | ||
@@ -238,0 +240,0 @@ reduce((acc, curr) => acc.concat(curr)), |
@@ -21,2 +21,3 @@ import { BlockView } from './block-view' | ||
const zh = zoomLevels[i] | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
if (zh && zh.reductionLevel <= 2 * basesPerPx) { | ||
@@ -23,0 +24,0 @@ return new BlockView( |
@@ -13,2 +13,5 @@ import { Buffer } from 'buffer' | ||
const decoder = | ||
typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined | ||
interface CoordRequest { | ||
@@ -219,3 +222,5 @@ chrId: number | ||
request, | ||
}).catch(e => observer.error(e)) | ||
}).catch((e: unknown) => { | ||
observer.error(e) | ||
}) | ||
} | ||
@@ -256,3 +261,4 @@ } | ||
return cirFobRecur([Number(cirTreeOffset) + 48], 1) | ||
cirFobRecur([Number(cirTreeOffset) + 48], 1) | ||
return | ||
} catch (e) { | ||
@@ -338,3 +344,4 @@ observer.error(e) | ||
} | ||
const rest = data.subarray(currOffset, i).toString() | ||
const b = data.subarray(currOffset, i) | ||
const rest = decoder?.decode(b) ?? b.toString() | ||
currOffset = i + 1 | ||
@@ -341,0 +348,0 @@ items.push({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243451
15
3990
6
+ Addedbuffer@^6.0.3
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedieee754@1.2.1(transitive)