@smithy/core
Advanced tools
@@ -1009,2 +1009,3 @@ const { createHmac, createHash, getRandomValues } = require("node:crypto"); | ||
| this.source.on("error", this.onSourceError); | ||
| this.source.on("close", this.onSourceClose); | ||
| this.source.pause(); | ||
@@ -1049,6 +1050,15 @@ } | ||
| }; | ||
| _read(size) { | ||
| onSourceClose = () => { | ||
| if (!this.destroyed && !this.source.readableEnded) { | ||
| this.destroy(new Error("Connection lost or stream closed before all data was received.")); | ||
| } | ||
| }; | ||
| _read(_size) { | ||
| this.source.resume(); | ||
| } | ||
| _destroy(error, callback) { | ||
| this.source?.removeListener("data", this.onSourceData); | ||
| this.source?.removeListener("end", this.onSourceEnd); | ||
| this.source?.removeListener("error", this.onSourceError); | ||
| this.source?.removeListener("close", this.onSourceClose); | ||
| this.source?.destroy(); | ||
@@ -1055,0 +1065,0 @@ callback(error); |
@@ -22,2 +22,3 @@ import { Readable } from "node:stream"; | ||
| this.source.on("error", this.onSourceError); | ||
| this.source.on("close", this.onSourceClose); | ||
| this.source.pause(); | ||
@@ -62,6 +63,15 @@ } | ||
| }; | ||
| _read(size) { | ||
| onSourceClose = () => { | ||
| if (!this.destroyed && !this.source.readableEnded) { | ||
| this.destroy(new Error("Connection lost or stream closed before all data was received.")); | ||
| } | ||
| }; | ||
| _read(_size) { | ||
| this.source.resume(); | ||
| } | ||
| _destroy(error, callback) { | ||
| this.source?.removeListener("data", this.onSourceData); | ||
| this.source?.removeListener("end", this.onSourceEnd); | ||
| this.source?.removeListener("error", this.onSourceError); | ||
| this.source?.removeListener("close", this.onSourceClose); | ||
| this.source?.destroy(); | ||
@@ -68,0 +78,0 @@ callback(error); |
@@ -43,7 +43,7 @@ import { Readable } from "node:stream"; | ||
| export declare class ChecksumStream extends Readable { | ||
| private expectedChecksum; | ||
| private checksumSourceLocation; | ||
| private readonly expectedChecksum; | ||
| private readonly checksumSourceLocation; | ||
| private checksum; | ||
| private source; | ||
| private base64Encoder; | ||
| private readonly base64Encoder; | ||
| constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }: ChecksumStreamInit<Readable>); | ||
@@ -64,2 +64,7 @@ /** | ||
| /** | ||
| * If the source stream closes without having ended, | ||
| * this is considered an error. | ||
| */ | ||
| private onSourceClose; | ||
| /** | ||
| * Resume the source so it flows at the rate this stream is consumed. | ||
@@ -69,3 +74,3 @@ * Do not call this directly. | ||
| */ | ||
| _read(size: number): void; | ||
| _read(_size: number): void; | ||
| /** | ||
@@ -72,0 +77,0 @@ * Destroy the upstream source for cleanup so it is not left dangling, then |
@@ -43,7 +43,7 @@ import { Readable } from "node:stream"; | ||
| export declare class ChecksumStream extends Readable { | ||
| private expectedChecksum; | ||
| private checksumSourceLocation; | ||
| private readonly expectedChecksum; | ||
| private readonly checksumSourceLocation; | ||
| private checksum; | ||
| private source; | ||
| private base64Encoder; | ||
| private readonly base64Encoder; | ||
| constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }: ChecksumStreamInit<Readable>); | ||
@@ -64,2 +64,7 @@ /** | ||
| /** | ||
| * If the source stream closes without having ended, | ||
| * this is considered an error. | ||
| */ | ||
| private onSourceClose; | ||
| /** | ||
| * Resume the source so it flows at the rate this stream is consumed. | ||
@@ -69,3 +74,3 @@ * Do not call this directly. | ||
| */ | ||
| _read(size: number): void; | ||
| _read(_size: number): void; | ||
| /** | ||
@@ -72,0 +77,0 @@ * Destroy the upstream source for cleanup so it is not left dangling, then |
+1
-1
| { | ||
| "name": "@smithy/core", | ||
| "version": "3.29.4", | ||
| "version": "3.29.5", | ||
| "scripts": { | ||
@@ -5,0 +5,0 @@ "benchmark:cbor": "node ./scripts/cbor-perf.mjs", |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1650381
0.08%40951
0.07%