then-read-stream
Advanced tools
Comparing version 1.0.0 to 1.0.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var assert = require("assert"); | ||
var Deferred = /** @class */ (function () { | ||
@@ -47,3 +48,3 @@ function Deferred() { | ||
return this.read(buffer, offset, length).then(function (bytesRead) { | ||
_this.peekQueue.push(buffer.slice(offset, length)); | ||
_this.peekQueue.push(buffer.slice(offset, bytesRead)); | ||
return bytesRead; | ||
@@ -95,4 +96,3 @@ }); | ||
var _this = this; | ||
if (this.request) | ||
throw new Error("Concurrent read operation"); | ||
assert.ok(!this.request, "Concurrent read operation?"); | ||
if (this.endOfStream) { | ||
@@ -104,3 +104,3 @@ return Promise.reject(exports.EndOfStream); | ||
readBuffer.copy(buffer, offset); | ||
return Promise.resolve(length); | ||
return Promise.resolve(readBuffer.length); | ||
} | ||
@@ -107,0 +107,0 @@ else { |
{ | ||
"name": "then-read-stream", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Read from a readable stream just like a file", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is too big to display
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
99774