multipasta
Advanced tools
Comparing version
@@ -76,11 +76,13 @@ "use strict"; | ||
}); | ||
} | ||
_read(_size) { | ||
if (this.#writeCallback !== undefined) { | ||
this.on("drain", () => { | ||
this.#canWrite = true; | ||
this.#writeCallback(); | ||
this.#writeCallback = undefined; | ||
} | ||
if (this.#writeCallback !== undefined) { | ||
this.#writeCallback(); | ||
this.#writeCallback = undefined; | ||
} | ||
}); | ||
} | ||
_read(_size) {} | ||
_write(chunk, encoding, callback) { | ||
const canWrite = this.#canWrite; | ||
if (chunk instanceof Uint8Array) { | ||
@@ -91,3 +93,3 @@ this.#parser.write(chunk); | ||
} | ||
if (this.#canWrite) { | ||
if (canWrite) { | ||
callback(); | ||
@@ -115,4 +117,5 @@ } else { | ||
} | ||
_read(_size) {} | ||
} | ||
exports.FileStream = FileStream; | ||
//# sourceMappingURL=node.js.map |
@@ -36,3 +36,4 @@ /// <reference types="node" resolution-mode="require"/> | ||
constructor(info: MP.PartInfo); | ||
_read(_size: number): void; | ||
} | ||
//# sourceMappingURL=node.d.ts.map |
@@ -45,11 +45,13 @@ import * as MP from "./index.js"; | ||
}); | ||
} | ||
_read(_size) { | ||
if (this.#writeCallback !== undefined) { | ||
this.on("drain", () => { | ||
this.#canWrite = true; | ||
this.#writeCallback(); | ||
this.#writeCallback = undefined; | ||
} | ||
if (this.#writeCallback !== undefined) { | ||
this.#writeCallback(); | ||
this.#writeCallback = undefined; | ||
} | ||
}); | ||
} | ||
_read(_size) {} | ||
_write(chunk, encoding, callback) { | ||
const canWrite = this.#canWrite; | ||
if (chunk instanceof Uint8Array) { | ||
@@ -60,3 +62,3 @@ this.#parser.write(chunk); | ||
} | ||
if (this.#canWrite) { | ||
if (canWrite) { | ||
callback(); | ||
@@ -82,3 +84,4 @@ } else { | ||
} | ||
_read(_size) {} | ||
} | ||
//# sourceMappingURL=node.js.map |
{ | ||
"name": "multipasta", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -63,12 +63,14 @@ import * as MP from "./index.js" | ||
}) | ||
} | ||
_read(_size: number) { | ||
if (this.#writeCallback !== undefined) { | ||
this.on("drain", () => { | ||
this.#canWrite = true | ||
this.#writeCallback() | ||
this.#writeCallback = undefined | ||
} | ||
if (this.#writeCallback !== undefined) { | ||
this.#writeCallback() | ||
this.#writeCallback = undefined | ||
} | ||
}) | ||
} | ||
_read(_size: number) {} | ||
_write( | ||
@@ -79,2 +81,4 @@ chunk: any, | ||
): void { | ||
const canWrite = this.#canWrite | ||
if (chunk instanceof Uint8Array) { | ||
@@ -86,3 +90,3 @@ this.#parser.write(chunk) | ||
if (this.#canWrite) { | ||
if (canWrite) { | ||
callback() | ||
@@ -110,2 +114,3 @@ } else { | ||
} | ||
_read(_size: number) {} | ||
} |
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
169800
0.35%2867
0.35%