Comparing version 1.0.5 to 1.0.6
@@ -0,1 +1,8 @@ | ||
<a name="1.0.6"></a> | ||
## [1.0.6](https://github.com/GMOD/bam-js/compare/v1.0.5...v1.0.6) (2018-10-19) | ||
- Add bugfix for where bytes for an invalid request returns 0 resulting in pako unzip errors | ||
<a name="1.0.5"></a> | ||
@@ -2,0 +9,0 @@ ## [1.0.5](https://github.com/GMOD/bam-js/compare/v1.0.4...v1.0.5) (2018-10-16) |
@@ -130,3 +130,3 @@ 'use strict'; | ||
if (!ret) { | ||
_context.next = 13; | ||
_context.next = 15; | ||
break; | ||
@@ -142,2 +142,10 @@ } | ||
if (bytesRead) { | ||
_context.next = 12; | ||
break; | ||
} | ||
throw new Error('Error reading header'); | ||
case 12: | ||
if (bytesRead < ret) { | ||
@@ -148,21 +156,21 @@ buf = buf.slice(0, bytesRead); | ||
} | ||
_context.next = 16; | ||
_context.next = 18; | ||
break; | ||
case 13: | ||
_context.next = 15; | ||
case 15: | ||
_context.next = 17; | ||
return this.bam.readFile(); | ||
case 15: | ||
case 17: | ||
buf = _context.sent; | ||
case 16: | ||
_context.next = 18; | ||
case 18: | ||
_context.next = 20; | ||
return unzip(buf); | ||
case 18: | ||
case 20: | ||
uncba = _context.sent; | ||
if (!(uncba.readInt32LE(0) !== BAM_MAGIC)) { | ||
_context.next = 21; | ||
_context.next = 23; | ||
break; | ||
@@ -173,3 +181,3 @@ } | ||
case 21: | ||
case 23: | ||
headLen = uncba.readInt32LE(4); | ||
@@ -179,6 +187,6 @@ | ||
this.header = uncba.toString('utf8', 8, 8 + headLen); | ||
_context.next = 25; | ||
_context.next = 27; | ||
return this._readRefSeqs(headLen + 8, 65535); | ||
case 25: | ||
case 27: | ||
_ref3 = _context.sent; | ||
@@ -193,3 +201,3 @@ chrToIndex = _ref3.chrToIndex; | ||
case 31: | ||
case 33: | ||
case 'end': | ||
@@ -228,2 +236,10 @@ return _context.stop(); | ||
if (bytesRead) { | ||
_context2.next = 6; | ||
break; | ||
} | ||
return _context2.abrupt('return', new Error('Error reading refseqs from header')); | ||
case 6: | ||
if (bytesRead < refSeqBytes) { | ||
@@ -234,6 +250,6 @@ buf = buf.slice(0, bytesRead); | ||
} | ||
_context2.next = 7; | ||
_context2.next = 9; | ||
return unzip(buf); | ||
case 7: | ||
case 9: | ||
uncba = _context2.sent; | ||
@@ -246,5 +262,5 @@ nRef = uncba.readInt32LE(start); | ||
case 13: | ||
case 15: | ||
if (!(i < nRef)) { | ||
_context2.next = 27; | ||
_context2.next = 29; | ||
break; | ||
@@ -266,3 +282,3 @@ } | ||
if (!(p > uncba.length)) { | ||
_context2.next = 24; | ||
_context2.next = 26; | ||
break; | ||
@@ -274,11 +290,11 @@ } | ||
case 24: | ||
case 26: | ||
i += 1; | ||
_context2.next = 13; | ||
_context2.next = 15; | ||
break; | ||
case 27: | ||
case 29: | ||
return _context2.abrupt('return', { chrToIndex: chrToIndex, indexToChr: indexToChr }); | ||
case 28: | ||
case 30: | ||
case 'end': | ||
@@ -560,2 +576,10 @@ return _context2.stop(); | ||
if (bytesRead) { | ||
_context5.next = 7; | ||
break; | ||
} | ||
return _context5.abrupt('return', []); | ||
case 7: | ||
if (bytesRead < bufsize) { | ||
@@ -567,10 +591,10 @@ buf = buf.slice(0, bytesRead); | ||
_context5.next = 8; | ||
_context5.next = 10; | ||
return unzip(buf); | ||
case 8: | ||
case 10: | ||
data = _context5.sent; | ||
return _context5.abrupt('return', this.readBamFeatures(data, chunk.minv.dataPosition)); | ||
case 10: | ||
case 12: | ||
case 'end': | ||
@@ -577,0 +601,0 @@ return _context5.stop(); |
{ | ||
"name": "@gmod/bam", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Parser for BAM and BAM index (bai) files", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
126423
2047