hypercore-byte-stream
Advanced tools
Comparing version 1.0.2 to 1.0.3
10
index.js
@@ -35,3 +35,3 @@ const assert = require('assert') | ||
assert(!blockLength || blockLength >= 0, 'end must be >= 0') | ||
assert(!byteLength || byteLength >= -1, 'length must be a positive integer or -1') | ||
assert(!byteLength || byteLength >= 0, 'length must be a >= 0 or -1') | ||
@@ -41,3 +41,3 @@ this.feed = feed | ||
start: blockOffset || 0, | ||
end: (blockOffset && blockLength) ? blockOffset + blockLength : -1, | ||
end: (blockOffset && (blockLength !== undefined)) ? blockOffset + blockLength : -1, | ||
byteOffset: byteOffset || 0, | ||
@@ -86,3 +86,3 @@ length: (byteLength !== undefined) ? byteLength : -1 | ||
function onstart (err, index, off) { | ||
if (err) return cb(err) | ||
if (err) return self.destroy(err) | ||
if (self._ended || self.destroyed) return | ||
@@ -140,2 +140,4 @@ | ||
if (this._ended) return this.push(null) | ||
if (this._range.length === 0) return this.push(null) | ||
if (!this._opened) { | ||
@@ -145,3 +147,3 @@ return this._open(size) | ||
if (this._range.end !== -1 && this._range.start > this._range.end || this._range.length === 0) { | ||
if ((this._range.end !== -1 && this._range.start > this._range.end) || this._range.length === 0) { | ||
return this.push(null) | ||
@@ -148,0 +150,0 @@ } |
{ | ||
"name": "hypercore-byte-stream", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A Readable stream wrapper around Hypercore that supports reading byte ranges.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
394
15400
9