web-streams-shim 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -31,13 +31,13 @@ Each polyfill performs feature detection before initializing. If a feature is de
31
31
  The library adds **comprehensive support for modern JavaScript iteration patterns** to `ReadableStream` and its readers.
32
32
 
33
33
  ![ReadableStream.asyncIterator](https://caniuse.smokestack.workers.dev/?feature=ReadableStream.@@asyncIterator)
34
-
35
34
  | | | |
36
35
  | :--- | :--- | :--- |
37
36
  | [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) | [`[Symbol.asyncIterator]`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator) | Allows the stream to be directly iterable in `for-await-of` loops. |
38
37
 
39
- ![ReadableStream.values](https://caniuse.smokestack.workers.dev/?feature=api.ReadableStream.values)
38
+
40
39
 
40
+ ![ReadableStream.values](https://caniuse.smokestack.workers.dev/?feature=api.ReadableStream.values)
41
41
  | | | |
42
42
  | :--- | :--- | :--- |
43
43
  | [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) | `values()` | An alias for `[Symbol.asyncIterator]` for explicit iteration. |
@@ -47,24 +47,25 @@ The library adds **comprehensive support for modern JavaScript iteration pattern
47
47
 
48
48
  The library adds the static method for creating streams from existing data sources.
49
49
 
50
+ ![ReadableStream.from](https://caniuse.smokestack.workers.dev/?feature=ReadableStream.from)
50
51
  | | | |
51
52
  | :--- | :--- | :--- |
52
53
  | [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) | [`from(obj)`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/from_static) | **Creates a new `ReadableStream` from any iterable or async iterable object**. It handles both synchronous and asynchronous iterators, including objects that yield `Promise`-like values. |
53
54
 
54
- ![ReadableStream.from](https://caniuse.smokestack.workers.dev/?feature=ReadableStream.from)
55
+
55
56
 
56
57
  ### Body Shim
57
58
 
58
59
  This shim ensures `Request` and `Response` objects consistently expose their body as a stream.
59
60
 
60
61
  ![Request.body](https://caniuse.smokestack.workers.dev/?feature=Request.body)
61
-
62
62
  | | | |
63
63
  | :--- | :--- | :--- |
64
64
  | [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/body) | [`body`](https://developer.mozilla.org/en-US/docs/Web/API/Request/body) | Polyfills the `body` property to return a **`ReadableStream` representation of the body content**. This is crucial for environments where `fetch` exists but streaming is absent. |
65
65
 
66
- ![Response.body](https://caniuse.smokestack.workers.dev/?feature=api.Response.body)
66
+
67
67
 
68
+ ![Response.body](https://caniuse.smokestack.workers.dev/?feature=api.Response.body)
68
69
  | | | |
69
70
  | :--- | :--- | :--- |
70
71
  | [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response/body) | [`body`](https://developer.mozilla.org/en-US/docs/Web/API/Response/body) | Provides the body content as a `ReadableStream`. |
@@ -75,19 +76,20 @@ This shim ensures `Request` and `Response` objects consistently expose their bod
75
76
  This shim ensures `Request` and `Response`, and `Blob` objects consistently provide the `bytes()` utility.
76
77
 
77
78
  ![Request.bytes](https://caniuse.smokestack.workers.dev/?feature=Request.bytes)
78
-
79
79
  | | | |
80
80
  | :--- | :--- | :--- |
81
81
  | [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/bytes) | [`bytes()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | Adds the `bytes()` method, which **asynchronously returns the object's body/content as a `Uint8Array`**. |
82
82
 
83
- ![Response.bytes](https://caniuse.smokestack.workers.dev/?feature=Response.bytes)
83
+
84
84
 
85
+ ![Response.bytes](https://caniuse.smokestack.workers.dev/?feature=Response.bytes)
85
86
  | | | |
86
87
  | :--- | :--- | :--- |
87
88
  | [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response/bytes) | [`bytes()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | Adds the `bytes()` method, which **asynchronously returns the object's body/content as a `Uint8Array`**. |
88
89
 
89
- ![Blob.bytes](https://caniuse.smokestack.workers.dev/?feature=Blob.bytes)
90
+
90
91
 
92
+ ![Blob.bytes](https://caniuse.smokestack.workers.dev/?feature=Blob.bytes)
91
93
  | | | |
92
94
  | :--- | :--- | :--- |
93
95
  | [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob/bytes) | [`bytes()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | Adds the `bytes()` method, which **asynchronously returns the object's body/content as a `Uint8Array`**. |
@@ -109,7 +111,6 @@ To satisfy modern `fetch` specifications when streaming request bodies, the libr
109
111
  The library adds support for the `ReadableStreamDefaultReader` constructor.
110
112
 
111
113
  ![ReadableStreamDefaultReader.constructor](https://caniuse.smokestack.workers.dev/?feature=ReadableStreamDefaultReader.constructor)
112
-
113
114
  | | | |
114
115
  | :--- | :--- | :--- |
115
116
  | [`ReadableStreamDefaultReader`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader) | [`constructor(stream)`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/ReadableStreamDefaultReader) | **Polyfills the `ReadableStreamDefaultReader` constructor** to accept a stream directly. In environments where the native constructor doesn't support this (like Bun), it delegates to `stream.getReader()` and properly sets up the prototype chain. This allows `new ReadableStreamDefaultReader(stream)` to work consistently across all runtimes. |
@@ -123,7 +124,8 @@ The library adds support for the `ReadableStreamDefaultReader` constructor.
123
124
 
124
125
  ![ReadableStreamBYOBRequest](https://caniuse.smokestack.workers.dev/?feature=ReadableStreamBYOBRequest)
125
126
 
126
- ![ReadableByteStreamContoller](https://caniuse.smokestack.workers.dev/?feature=ReadableByteStreamContoller)
127
+ ![ReadableByteStreamContoller](https://caniuse.smokestack.workers.dev/?feature=ReadableByteStreamController)
127
128
 
129
+ ![ReadableByteStreamContoller.byobRequest](https://caniuse.smokestack.workers.dev/?feature=ReadableByteStreamController.byobRequest)
128
130
 
129
131
  ![](https://cdn.jsdelivr.net/npm/web-streams-shim/web-streams-core.js)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-streams-shim",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "web-streams-core.js",
6
6
  "scripts": {