elysia 1.3.3 → 1.3.4-exp.0

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.
@@ -222,7 +222,7 @@ var redirect = (url, status2 = 302) => Response.redirect(url, status2), ELYSIA_F
222
222
  };
223
223
  var isNotEmpty = (obj) => {
224
224
  if (!obj) return !1;
225
- for (let x in obj) return !0;
225
+ for (let _ in obj) return !0;
226
226
  return !1;
227
227
  };
228
228
  var supportPerMethodInlineHandler = (() => {
@@ -1479,11 +1479,19 @@ var handleFile = (response, set2) => {
1479
1479
  return set2;
1480
1480
  }, createStreamHandler = ({ mapResponse: mapResponse2, mapCompactResponse: mapCompactResponse2 }) => async (generator, set2, request) => {
1481
1481
  let init = generator.next();
1482
- return init instanceof Promise && (init = await init), init.done ? set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request) : (set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = "text/event-stream; charset=utf-8")) : set2 = {
1482
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
1483
+ return set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request);
1484
+ let contentType = (
1485
+ // @ts-ignore
1486
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
1487
+ );
1488
+ return set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = contentType), set2.headers["cache-control"] || (set2.headers["cache-control"] = "no-cache")) : set2 = {
1483
1489
  status: 200,
1484
1490
  headers: {
1485
- "content-type": "text/event-stream; charset=utf-8",
1486
- "transfer-encoding": "chunked"
1491
+ "content-type": contentType,
1492
+ "transfer-encoding": "chunked",
1493
+ "cache-control": "no-cache",
1494
+ connection: "keep-alive"
1487
1495
  }
1488
1496
  }, new Response(
1489
1497
  new ReadableStream({
@@ -1496,7 +1504,9 @@ var handleFile = (response, set2) => {
1496
1504
  } catch {
1497
1505
  }
1498
1506
  }), init.value !== void 0 && init.value !== null)
1499
- if (typeof init.value == "object")
1507
+ if (init.value.toStream)
1508
+ controller.enqueue(init.value.toStream());
1509
+ else if (typeof init.value == "object")
1500
1510
  try {
1501
1511
  controller.enqueue(
1502
1512
  Buffer.from(JSON.stringify(init.value))
@@ -1513,7 +1523,9 @@ var handleFile = (response, set2) => {
1513
1523
  for await (let chunk of generator) {
1514
1524
  if (end) break;
1515
1525
  if (chunk != null) {
1516
- if (typeof chunk == "object")
1526
+ if (chunk.toStream)
1527
+ controller.enqueue(chunk.toStream());
1528
+ else if (typeof chunk == "object")
1517
1529
  try {
1518
1530
  controller.enqueue(
1519
1531
  Buffer.from(JSON.stringify(chunk))
@@ -1536,7 +1548,7 @@ var handleFile = (response, set2) => {
1536
1548
  }
1537
1549
  }),
1538
1550
  set2
1539
- ));
1551
+ );
1540
1552
  };
1541
1553
  async function* streamResponse(response) {
1542
1554
  let body = response.body;
@@ -100,7 +100,7 @@ var encoder = new TextEncoder();
100
100
  var ELYSIA_FORM_DATA = Symbol("ElysiaFormData"), ELYSIA_REQUEST_ID = Symbol("ElysiaRequestId");
101
101
  var isNotEmpty = (obj) => {
102
102
  if (!obj) return !1;
103
- for (let x in obj) return !0;
103
+ for (let _ in obj) return !0;
104
104
  return !1;
105
105
  };
106
106
  var supportPerMethodInlineHandler = (() => {
@@ -338,11 +338,19 @@ var handleFile = (response, set2) => {
338
338
  return set2;
339
339
  }, createStreamHandler = ({ mapResponse: mapResponse2, mapCompactResponse: mapCompactResponse2 }) => async (generator, set2, request) => {
340
340
  let init = generator.next();
341
- return init instanceof Promise && (init = await init), init.done ? set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request) : (set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = "text/event-stream; charset=utf-8")) : set2 = {
341
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
342
+ return set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request);
343
+ let contentType = (
344
+ // @ts-ignore
345
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
346
+ );
347
+ return set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = contentType), set2.headers["cache-control"] || (set2.headers["cache-control"] = "no-cache")) : set2 = {
342
348
  status: 200,
343
349
  headers: {
344
- "content-type": "text/event-stream; charset=utf-8",
345
- "transfer-encoding": "chunked"
350
+ "content-type": contentType,
351
+ "transfer-encoding": "chunked",
352
+ "cache-control": "no-cache",
353
+ connection: "keep-alive"
346
354
  }
347
355
  }, new Response(
348
356
  new ReadableStream({
@@ -355,7 +363,9 @@ var handleFile = (response, set2) => {
355
363
  } catch {
356
364
  }
357
365
  }), init.value !== void 0 && init.value !== null)
358
- if (typeof init.value == "object")
366
+ if (init.value.toStream)
367
+ controller.enqueue(init.value.toStream());
368
+ else if (typeof init.value == "object")
359
369
  try {
360
370
  controller.enqueue(
361
371
  Buffer.from(JSON.stringify(init.value))
@@ -372,7 +382,9 @@ var handleFile = (response, set2) => {
372
382
  for await (let chunk of generator) {
373
383
  if (end) break;
374
384
  if (chunk != null) {
375
- if (typeof chunk == "object")
385
+ if (chunk.toStream)
386
+ controller.enqueue(chunk.toStream());
387
+ else if (typeof chunk == "object")
376
388
  try {
377
389
  controller.enqueue(
378
390
  Buffer.from(JSON.stringify(chunk))
@@ -395,7 +407,7 @@ var handleFile = (response, set2) => {
395
407
  }
396
408
  }),
397
409
  set2
398
- ));
410
+ );
399
411
  };
400
412
  async function* streamResponse(response) {
401
413
  let body = response.body;
@@ -100,7 +100,7 @@ var encoder = new TextEncoder();
100
100
  var ELYSIA_FORM_DATA = Symbol("ElysiaFormData"), ELYSIA_REQUEST_ID = Symbol("ElysiaRequestId");
101
101
  var isNotEmpty = (obj) => {
102
102
  if (!obj) return !1;
103
- for (let x in obj) return !0;
103
+ for (let _ in obj) return !0;
104
104
  return !1;
105
105
  };
106
106
  var supportPerMethodInlineHandler = (() => {
@@ -338,11 +338,19 @@ var handleFile = (response, set2) => {
338
338
  return set2;
339
339
  }, createStreamHandler = ({ mapResponse: mapResponse2, mapCompactResponse: mapCompactResponse2 }) => async (generator, set2, request) => {
340
340
  let init = generator.next();
341
- return init instanceof Promise && (init = await init), init.done ? set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request) : (set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = "text/event-stream; charset=utf-8")) : set2 = {
341
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
342
+ return set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request);
343
+ let contentType = (
344
+ // @ts-ignore
345
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
346
+ );
347
+ return set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = contentType), set2.headers["cache-control"] || (set2.headers["cache-control"] = "no-cache")) : set2 = {
342
348
  status: 200,
343
349
  headers: {
344
- "content-type": "text/event-stream; charset=utf-8",
345
- "transfer-encoding": "chunked"
350
+ "content-type": contentType,
351
+ "transfer-encoding": "chunked",
352
+ "cache-control": "no-cache",
353
+ connection: "keep-alive"
346
354
  }
347
355
  }, new Response(
348
356
  new ReadableStream({
@@ -355,7 +363,9 @@ var handleFile = (response, set2) => {
355
363
  } catch {
356
364
  }
357
365
  }), init.value !== void 0 && init.value !== null)
358
- if (typeof init.value == "object")
366
+ if (init.value.toStream)
367
+ controller.enqueue(init.value.toStream());
368
+ else if (typeof init.value == "object")
359
369
  try {
360
370
  controller.enqueue(
361
371
  Buffer.from(JSON.stringify(init.value))
@@ -372,7 +382,9 @@ var handleFile = (response, set2) => {
372
382
  for await (let chunk of generator) {
373
383
  if (end) break;
374
384
  if (chunk != null) {
375
- if (typeof chunk == "object")
385
+ if (chunk.toStream)
386
+ controller.enqueue(chunk.toStream());
387
+ else if (typeof chunk == "object")
376
388
  try {
377
389
  controller.enqueue(
378
390
  Buffer.from(JSON.stringify(chunk))
@@ -395,7 +407,7 @@ var handleFile = (response, set2) => {
395
407
  }
396
408
  }),
397
409
  set2
398
- ));
410
+ );
399
411
  };
400
412
  async function* streamResponse(response) {
401
413
  let body = response.body;
@@ -240,7 +240,7 @@ var redirect = (url, status2 = 302) => Response.redirect(url, status2), ELYSIA_F
240
240
  };
241
241
  var isNotEmpty = (obj) => {
242
242
  if (!obj) return !1;
243
- for (let x in obj) return !0;
243
+ for (let _ in obj) return !0;
244
244
  return !1;
245
245
  };
246
246
  var supportPerMethodInlineHandler = (() => {
@@ -604,11 +604,19 @@ var handleFile = (response, set2) => {
604
604
  return set2;
605
605
  }, createStreamHandler = ({ mapResponse: mapResponse3, mapCompactResponse: mapCompactResponse3 }) => async (generator, set2, request) => {
606
606
  let init = generator.next();
607
- return init instanceof Promise && (init = await init), init.done ? set2 ? mapResponse3(init.value, set2, request) : mapCompactResponse3(init.value, request) : (set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = "text/event-stream; charset=utf-8")) : set2 = {
607
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
608
+ return set2 ? mapResponse3(init.value, set2, request) : mapCompactResponse3(init.value, request);
609
+ let contentType = (
610
+ // @ts-ignore
611
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
612
+ );
613
+ return set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = contentType), set2.headers["cache-control"] || (set2.headers["cache-control"] = "no-cache")) : set2 = {
608
614
  status: 200,
609
615
  headers: {
610
- "content-type": "text/event-stream; charset=utf-8",
611
- "transfer-encoding": "chunked"
616
+ "content-type": contentType,
617
+ "transfer-encoding": "chunked",
618
+ "cache-control": "no-cache",
619
+ connection: "keep-alive"
612
620
  }
613
621
  }, new Response(
614
622
  new ReadableStream({
@@ -621,7 +629,9 @@ var handleFile = (response, set2) => {
621
629
  } catch {
622
630
  }
623
631
  }), init.value !== void 0 && init.value !== null)
624
- if (typeof init.value == "object")
632
+ if (init.value.toStream)
633
+ controller.enqueue(init.value.toStream());
634
+ else if (typeof init.value == "object")
625
635
  try {
626
636
  controller.enqueue(
627
637
  Buffer.from(JSON.stringify(init.value))
@@ -638,7 +648,9 @@ var handleFile = (response, set2) => {
638
648
  for await (let chunk of generator) {
639
649
  if (end) break;
640
650
  if (chunk != null) {
641
- if (typeof chunk == "object")
651
+ if (chunk.toStream)
652
+ controller.enqueue(chunk.toStream());
653
+ else if (typeof chunk == "object")
642
654
  try {
643
655
  controller.enqueue(
644
656
  Buffer.from(JSON.stringify(chunk))
@@ -661,7 +673,7 @@ var handleFile = (response, set2) => {
661
673
  }
662
674
  }),
663
675
  set2
664
- ));
676
+ );
665
677
  };
666
678
  async function* streamResponse(response) {
667
679
  let body = response.body;
@@ -3,7 +3,7 @@ import type { Context } from '../context';
3
3
  export declare const handleFile: (response: File | Blob, set?: Context["set"]) => Response;
4
4
  export declare const parseSetCookies: (headers: Headers, setCookie: string[]) => Headers;
5
5
  export declare const responseToSetHeaders: (response: Response, set?: Context["set"]) => {
6
- headers: import("../types").HTTPHeaders;
6
+ headers: import("..").HTTPHeaders;
7
7
  status?: number | keyof StatusMap;
8
8
  redirect?: string;
9
9
  cookie?: Record<string, import("../cookies").ElysiaCookie>;
@@ -100,7 +100,7 @@ var encoder = new TextEncoder();
100
100
  var ELYSIA_FORM_DATA = Symbol("ElysiaFormData"), ELYSIA_REQUEST_ID = Symbol("ElysiaRequestId");
101
101
  var isNotEmpty = (obj) => {
102
102
  if (!obj) return !1;
103
- for (let x in obj) return !0;
103
+ for (let _ in obj) return !0;
104
104
  return !1;
105
105
  };
106
106
  var supportPerMethodInlineHandler = (() => {
@@ -219,11 +219,19 @@ var handleFile = (response, set) => {
219
219
  return set;
220
220
  }, createStreamHandler = ({ mapResponse, mapCompactResponse }) => async (generator, set, request) => {
221
221
  let init = generator.next();
222
- return init instanceof Promise && (init = await init), init.done ? set ? mapResponse(init.value, set, request) : mapCompactResponse(init.value, request) : (set?.headers ? (set.headers["transfer-encoding"] || (set.headers["transfer-encoding"] = "chunked"), set.headers["content-type"] || (set.headers["content-type"] = "text/event-stream; charset=utf-8")) : set = {
222
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
223
+ return set ? mapResponse(init.value, set, request) : mapCompactResponse(init.value, request);
224
+ let contentType = (
225
+ // @ts-ignore
226
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
227
+ );
228
+ return set?.headers ? (set.headers["transfer-encoding"] || (set.headers["transfer-encoding"] = "chunked"), set.headers["content-type"] || (set.headers["content-type"] = contentType), set.headers["cache-control"] || (set.headers["cache-control"] = "no-cache")) : set = {
223
229
  status: 200,
224
230
  headers: {
225
- "content-type": "text/event-stream; charset=utf-8",
226
- "transfer-encoding": "chunked"
231
+ "content-type": contentType,
232
+ "transfer-encoding": "chunked",
233
+ "cache-control": "no-cache",
234
+ connection: "keep-alive"
227
235
  }
228
236
  }, new Response(
229
237
  new ReadableStream({
@@ -236,7 +244,9 @@ var handleFile = (response, set) => {
236
244
  } catch {
237
245
  }
238
246
  }), init.value !== void 0 && init.value !== null)
239
- if (typeof init.value == "object")
247
+ if (init.value.toStream)
248
+ controller.enqueue(init.value.toStream());
249
+ else if (typeof init.value == "object")
240
250
  try {
241
251
  controller.enqueue(
242
252
  Buffer.from(JSON.stringify(init.value))
@@ -253,7 +263,9 @@ var handleFile = (response, set) => {
253
263
  for await (let chunk of generator) {
254
264
  if (end) break;
255
265
  if (chunk != null) {
256
- if (typeof chunk == "object")
266
+ if (chunk.toStream)
267
+ controller.enqueue(chunk.toStream());
268
+ else if (typeof chunk == "object")
257
269
  try {
258
270
  controller.enqueue(
259
271
  Buffer.from(JSON.stringify(chunk))
@@ -276,7 +288,7 @@ var handleFile = (response, set) => {
276
288
  }
277
289
  }),
278
290
  set
279
- ));
291
+ );
280
292
  };
281
293
  async function* streamResponse(response) {
282
294
  let body = response.body;
@@ -100,7 +100,7 @@ var encoder = new TextEncoder();
100
100
  var ELYSIA_FORM_DATA = Symbol("ElysiaFormData"), ELYSIA_REQUEST_ID = Symbol("ElysiaRequestId");
101
101
  var isNotEmpty = (obj) => {
102
102
  if (!obj) return !1;
103
- for (let x in obj) return !0;
103
+ for (let _ in obj) return !0;
104
104
  return !1;
105
105
  };
106
106
  var supportPerMethodInlineHandler = (() => {
@@ -338,11 +338,19 @@ var handleFile = (response, set2) => {
338
338
  return set2;
339
339
  }, createStreamHandler = ({ mapResponse: mapResponse2, mapCompactResponse: mapCompactResponse2 }) => async (generator, set2, request) => {
340
340
  let init = generator.next();
341
- return init instanceof Promise && (init = await init), init.done ? set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request) : (set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = "text/event-stream; charset=utf-8")) : set2 = {
341
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
342
+ return set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request);
343
+ let contentType = (
344
+ // @ts-ignore
345
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
346
+ );
347
+ return set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = contentType), set2.headers["cache-control"] || (set2.headers["cache-control"] = "no-cache")) : set2 = {
342
348
  status: 200,
343
349
  headers: {
344
- "content-type": "text/event-stream; charset=utf-8",
345
- "transfer-encoding": "chunked"
350
+ "content-type": contentType,
351
+ "transfer-encoding": "chunked",
352
+ "cache-control": "no-cache",
353
+ connection: "keep-alive"
346
354
  }
347
355
  }, new Response(
348
356
  new ReadableStream({
@@ -355,7 +363,9 @@ var handleFile = (response, set2) => {
355
363
  } catch {
356
364
  }
357
365
  }), init.value !== void 0 && init.value !== null)
358
- if (typeof init.value == "object")
366
+ if (init.value.toStream)
367
+ controller.enqueue(init.value.toStream());
368
+ else if (typeof init.value == "object")
359
369
  try {
360
370
  controller.enqueue(
361
371
  Buffer.from(JSON.stringify(init.value))
@@ -372,7 +382,9 @@ var handleFile = (response, set2) => {
372
382
  for await (let chunk of generator) {
373
383
  if (end) break;
374
384
  if (chunk != null) {
375
- if (typeof chunk == "object")
385
+ if (chunk.toStream)
386
+ controller.enqueue(chunk.toStream());
387
+ else if (typeof chunk == "object")
376
388
  try {
377
389
  controller.enqueue(
378
390
  Buffer.from(JSON.stringify(chunk))
@@ -395,7 +407,7 @@ var handleFile = (response, set2) => {
395
407
  }
396
408
  }),
397
409
  set2
398
- ));
410
+ );
399
411
  };
400
412
  async function* streamResponse(response) {
401
413
  let body = response.body;
@@ -100,7 +100,7 @@ var encoder = new TextEncoder();
100
100
  var ELYSIA_FORM_DATA = Symbol("ElysiaFormData"), ELYSIA_REQUEST_ID = Symbol("ElysiaRequestId");
101
101
  var isNotEmpty = (obj) => {
102
102
  if (!obj) return !1;
103
- for (let x in obj) return !0;
103
+ for (let _ in obj) return !0;
104
104
  return !1;
105
105
  };
106
106
  var supportPerMethodInlineHandler = (() => {
@@ -338,11 +338,19 @@ var handleFile = (response, set2) => {
338
338
  return set2;
339
339
  }, createStreamHandler = ({ mapResponse: mapResponse2, mapCompactResponse: mapCompactResponse2 }) => async (generator, set2, request) => {
340
340
  let init = generator.next();
341
- return init instanceof Promise && (init = await init), init.done ? set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request) : (set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = "text/event-stream; charset=utf-8")) : set2 = {
341
+ if (init instanceof Promise && (init = await init), typeof init?.done > "u" || init?.done)
342
+ return set2 ? mapResponse2(init.value, set2, request) : mapCompactResponse2(init.value, request);
343
+ let contentType = (
344
+ // @ts-ignore
345
+ init.value && typeof init.value?.stream ? "text/event-stream" : init.value && typeof init.value == "object" ? "application/json" : "text/plain"
346
+ );
347
+ return set2?.headers ? (set2.headers["transfer-encoding"] || (set2.headers["transfer-encoding"] = "chunked"), set2.headers["content-type"] || (set2.headers["content-type"] = contentType), set2.headers["cache-control"] || (set2.headers["cache-control"] = "no-cache")) : set2 = {
342
348
  status: 200,
343
349
  headers: {
344
- "content-type": "text/event-stream; charset=utf-8",
345
- "transfer-encoding": "chunked"
350
+ "content-type": contentType,
351
+ "transfer-encoding": "chunked",
352
+ "cache-control": "no-cache",
353
+ connection: "keep-alive"
346
354
  }
347
355
  }, new Response(
348
356
  new ReadableStream({
@@ -355,7 +363,9 @@ var handleFile = (response, set2) => {
355
363
  } catch {
356
364
  }
357
365
  }), init.value !== void 0 && init.value !== null)
358
- if (typeof init.value == "object")
366
+ if (init.value.toStream)
367
+ controller.enqueue(init.value.toStream());
368
+ else if (typeof init.value == "object")
359
369
  try {
360
370
  controller.enqueue(
361
371
  Buffer.from(JSON.stringify(init.value))
@@ -372,7 +382,9 @@ var handleFile = (response, set2) => {
372
382
  for await (let chunk of generator) {
373
383
  if (end) break;
374
384
  if (chunk != null) {
375
- if (typeof chunk == "object")
385
+ if (chunk.toStream)
386
+ controller.enqueue(chunk.toStream());
387
+ else if (typeof chunk == "object")
376
388
  try {
377
389
  controller.enqueue(
378
390
  Buffer.from(JSON.stringify(chunk))
@@ -395,7 +407,7 @@ var handleFile = (response, set2) => {
395
407
  }
396
408
  }),
397
409
  set2
398
- ));
410
+ );
399
411
  };
400
412
  async function* streamResponse(response) {
401
413
  let body = response.body;
@@ -1814,9 +1814,9 @@ export { serializeCookie, Cookie, type CookieOptions } from './cookies';
1814
1814
  export type { Context, PreContext, ErrorContext } from './context';
1815
1815
  export { ELYSIA_TRACE, type TraceEvent, type TraceListener, type TraceHandler, type TraceProcess, type TraceStream } from './trace';
1816
1816
  export { getSchemaValidator, getResponseSchemaValidator, replaceSchemaType } from './schema';
1817
- export { mergeHook, mergeObjectArray, redirect, StatusMap, InvertedStatusMap, form, replaceUrlPath, checksum, cloneInference, deduplicateChecksum, ELYSIA_FORM_DATA, ELYSIA_REQUEST_ID } from './utils';
1817
+ export { mergeHook, mergeObjectArray, redirect, StatusMap, InvertedStatusMap, form, replaceUrlPath, checksum, cloneInference, deduplicateChecksum, ELYSIA_FORM_DATA, ELYSIA_REQUEST_ID, sse } from './utils';
1818
1818
  export { status, error, mapValueError, ParseError, NotFoundError, ValidationError, InternalServerError, InvalidCookieSignature, ERROR_CODE } from './error';
1819
- export type { EphemeralType, CreateEden, ComposeElysiaResponse, ElysiaConfig, SingletonBase, DefinitionBase, RouteBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, SchemaValidator, VoidHandler, PreHandler, BodyHandler, OptionalHandler, AfterResponseHandler, ErrorHandler, LifeCycleEvent, LifeCycleStore, LifeCycleType, MaybePromise, UnwrapSchema, Checksum, DocumentDecoration, InferContext, InferHandler, ResolvePath, MapResponse, MacroQueue, BaseMacro, MacroManager, BaseMacroFn, MacroToProperty, ResolveMacroContext, MergeElysiaInstances, MaybeArray, ModelValidator, MetadataBase, UnwrapBodySchema, UnwrapGroupGuardRoute, ModelValidatorError, ExcludeElysiaResponse, CoExist } from './types';
1819
+ export type { EphemeralType, CreateEden, ComposeElysiaResponse, ElysiaConfig, SingletonBase, DefinitionBase, RouteBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, SchemaValidator, VoidHandler, PreHandler, BodyHandler, OptionalHandler, AfterResponseHandler, ErrorHandler, LifeCycleEvent, LifeCycleStore, LifeCycleType, MaybePromise, UnwrapSchema, Checksum, DocumentDecoration, InferContext, InferHandler, ResolvePath, MapResponse, MacroQueue, BaseMacro, MacroManager, BaseMacroFn, MacroToProperty, ResolveMacroContext, MergeElysiaInstances, MaybeArray, ModelValidator, MetadataBase, UnwrapBodySchema, UnwrapGroupGuardRoute, ModelValidatorError, ExcludeElysiaResponse, SSEPayload, StandaloneInputSchema, MergeStandaloneSchema, MergeTypeModule, GracefulHandler, AfterHandler, InlineHandler, ResolveHandler, TransformHandler, HTTPHeaders } from './types';
1820
1820
  export { env } from './universal/env';
1821
1821
  export { file, ElysiaFile } from './universal/file';
1822
1822
  export type { ElysiaAdapter } from './adapter';