From db1a8d77445dc3f4aa01b89601f01bb26f969ed9 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Fri, 26 May 2023 17:26:04 +0100 Subject: [PATCH 1/3] Add Notes about Type Expections about Worker's Socket API --- .../workers/runtime-apis/streams/writablestreamdefaultwriter.md | 1 + content/workers/runtime-apis/tcp-sockets.md | 1 + 2 files changed, 2 insertions(+) diff --git a/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md b/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md index fbf4a7a4576f55..0c22bd5be393cc 100644 --- a/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md +++ b/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md @@ -72,6 +72,7 @@ await someResponse.body.pipeTo(writable); - {{}}write(chunk{{}}any{{}}){{}} : {{}}Promise\{{}} - Writes a chunk of data to the writer and returns a promise that resolves if the operation succeeds. + - The underlaying stream may accept fewer kinds of type than `any`, it will throw an exception when encountering an unexpected type. {{}} diff --git a/content/workers/runtime-apis/tcp-sockets.md b/content/workers/runtime-apis/tcp-sockets.md index 495f0a3d84a983..df6346d811cdc1 100644 --- a/content/workers/runtime-apis/tcp-sockets.md +++ b/content/workers/runtime-apis/tcp-sockets.md @@ -82,6 +82,7 @@ export default { - {{}}writable{{}} : {{}}WritableStream{{}} - Returns the writable side of the TCP socket. + - The `WriteableStream` returned only accept chunks of `Uint8Array` or its views. - `closed` {{}}`Promise`{{}} - This promise is resolved when the socket is closed and is rejected if the socket encounters an error. From b4964edfbd09142b6b544e593b0184b2c0695465 Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Sun, 8 Oct 2023 20:11:18 -0700 Subject: [PATCH 2/3] Update content/workers/runtime-apis/tcp-sockets.md --- content/workers/runtime-apis/tcp-sockets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/workers/runtime-apis/tcp-sockets.md b/content/workers/runtime-apis/tcp-sockets.md index df6346d811cdc1..444f639d393b43 100644 --- a/content/workers/runtime-apis/tcp-sockets.md +++ b/content/workers/runtime-apis/tcp-sockets.md @@ -82,7 +82,7 @@ export default { - {{}}writable{{}} : {{}}WritableStream{{}} - Returns the writable side of the TCP socket. - - The `WriteableStream` returned only accept chunks of `Uint8Array` or its views. + - The `WriteableStream` returned only accepts chunks of `Uint8Array` or its views. - `closed` {{}}`Promise`{{}} - This promise is resolved when the socket is closed and is rejected if the socket encounters an error. From fdae5ca69d88f5189cf1d75ab89d20212140cd2c Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Tue, 10 Oct 2023 15:35:04 -0700 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Dominik Picheta --- .../workers/runtime-apis/streams/writablestreamdefaultwriter.md | 2 +- content/workers/runtime-apis/tcp-sockets.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md b/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md index 0c22bd5be393cc..bcc3113a9a17ca 100644 --- a/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md +++ b/content/workers/runtime-apis/streams/writablestreamdefaultwriter.md @@ -72,7 +72,7 @@ await someResponse.body.pipeTo(writable); - {{}}write(chunk{{}}any{{}}){{}} : {{}}Promise\{{}} - Writes a chunk of data to the writer and returns a promise that resolves if the operation succeeds. - - The underlaying stream may accept fewer kinds of type than `any`, it will throw an exception when encountering an unexpected type. + - The underlying stream may accept fewer kinds of type than `any`, it will throw an exception when encountering an unexpected type. {{}} diff --git a/content/workers/runtime-apis/tcp-sockets.md b/content/workers/runtime-apis/tcp-sockets.md index 444f639d393b43..fdce21f4183511 100644 --- a/content/workers/runtime-apis/tcp-sockets.md +++ b/content/workers/runtime-apis/tcp-sockets.md @@ -82,7 +82,7 @@ export default { - {{}}writable{{}} : {{}}WritableStream{{}} - Returns the writable side of the TCP socket. - - The `WriteableStream` returned only accepts chunks of `Uint8Array` or its views. + - The `WritableStream` returned only accepts chunks of `Uint8Array` or its views. - `closed` {{}}`Promise`{{}} - This promise is resolved when the socket is closed and is rejected if the socket encounters an error.