@standardserver/fetch 0.0.2 → 0.0.4
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.
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getFilenameFromContentDisposition, generateContentDisposition } from '@standardserver/core';
|
|
2
2
|
import { AsyncIteratorClass, parseEmptyableJSON, isTypescriptObject, stringifyJSON, AbortError, isAsyncIteratorObject } from '@standardserver/shared';
|
|
3
|
-
import { EventStreamDecoderStream, withEventIteratorEventMeta, EventIteratorErrorEvent, encodeEventStreamMessage,
|
|
3
|
+
import { EventStreamDecoderStream, withEventIteratorEventMeta, EventIteratorErrorEvent, encodeEventStreamMessage, unwrapEventIteratorEvent, getEventIteratorEventMeta } from '@standardserver/core/event-stream';
|
|
4
4
|
|
|
5
5
|
function toEventIterator(stream) {
|
|
6
6
|
const eventStream = stream?.pipeThrough(new TextDecoderStream()).pipeThrough(new EventStreamDecoderStream());
|
|
@@ -78,7 +78,7 @@ function toEventStream(iterator, options = {}) {
|
|
|
78
78
|
if (cancelled) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const [data, meta] =
|
|
81
|
+
const [data, meta] = unwrapEventIteratorEvent(result.value);
|
|
82
82
|
if (alwaysSendCloseEvent || !result.done || data !== void 0 || meta !== void 0) {
|
|
83
83
|
const event = result.done ? "close" : "message";
|
|
84
84
|
controller.enqueue(encodeEventStreamMessage({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standardserver/fetch",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://standardserver.dev",
|
|
7
7
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@standardserver/core": "0.0.
|
|
24
|
-
"@standardserver/shared": "0.0.
|
|
23
|
+
"@standardserver/core": "0.0.4",
|
|
24
|
+
"@standardserver/shared": "0.0.4"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@hono/node-server": "^1.19.7"
|