elysia 1.4.23 → 1.4.25
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/adapter/utils.js +2 -7
- package/dist/adapter/utils.mjs +2 -7
- package/dist/bun/index.js +8 -8
- package/dist/bun/index.js.map +8 -8
- package/dist/compose.js +12 -2
- package/dist/compose.mjs +12 -2
- package/dist/cookies.d.ts +7 -3
- package/dist/cookies.js +12 -10
- package/dist/cookies.mjs +12 -10
- package/dist/error.d.ts +1 -0
- package/dist/error.js +3 -1
- package/dist/error.mjs +2 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/dist/types.d.ts +34 -12
- package/dist/utils.js +4 -3
- package/dist/utils.mjs +4 -3
- package/package.json +1 -1
package/dist/adapter/utils.js
CHANGED
|
@@ -27,7 +27,7 @@ __export(utils_exports, {
|
|
|
27
27
|
tee: () => tee
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(utils_exports);
|
|
30
|
-
var import_cookies = require('../cookies.js'), import_utils = require('../utils.js'),
|
|
30
|
+
var import_cookies = require('../cookies.js'), import_utils = require('../utils.js'), import_universal = require('../universal/index.js'), import_utils2 = require('../universal/utils.js');
|
|
31
31
|
const handleFile = (response, set) => {
|
|
32
32
|
if (!import_utils2.isBun && response instanceof Promise)
|
|
33
33
|
return response.then((res) => handleFile(res, set));
|
|
@@ -199,12 +199,7 @@ const handleSet = (set) => {
|
|
|
199
199
|
));
|
|
200
200
|
};
|
|
201
201
|
function mergeHeaders(responseHeaders, setHeaders) {
|
|
202
|
-
const headers = new Headers(
|
|
203
|
-
import_utils.hasHeaderShorthand ? (
|
|
204
|
-
// @ts-ignore
|
|
205
|
-
responseHeaders.toJSON()
|
|
206
|
-
) : Object.fromEntries(responseHeaders.entries())
|
|
207
|
-
);
|
|
202
|
+
const headers = new Headers(responseHeaders);
|
|
208
203
|
if (setHeaders instanceof Headers)
|
|
209
204
|
for (const key of setHeaders.keys())
|
|
210
205
|
if (key === "set-cookie") {
|
package/dist/adapter/utils.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { serializeCookie } from "../cookies.mjs";
|
|
2
2
|
import { hasHeaderShorthand, isNotEmpty, StatusMap } from "../utils.mjs";
|
|
3
|
-
import { isBun } from "../universal/utils.mjs";
|
|
4
3
|
import { env } from "../universal/index.mjs";
|
|
4
|
+
import { isBun } from "../universal/utils.mjs";
|
|
5
5
|
const handleFile = (response, set) => {
|
|
6
6
|
if (!isBun && response instanceof Promise)
|
|
7
7
|
return response.then((res) => handleFile(res, set));
|
|
@@ -173,12 +173,7 @@ const handleSet = (set) => {
|
|
|
173
173
|
));
|
|
174
174
|
};
|
|
175
175
|
function mergeHeaders(responseHeaders, setHeaders) {
|
|
176
|
-
const headers = new Headers(
|
|
177
|
-
hasHeaderShorthand ? (
|
|
178
|
-
// @ts-ignore
|
|
179
|
-
responseHeaders.toJSON()
|
|
180
|
-
) : Object.fromEntries(responseHeaders.entries())
|
|
181
|
-
);
|
|
176
|
+
const headers = new Headers(responseHeaders);
|
|
182
177
|
if (setHeaders instanceof Headers)
|
|
183
178
|
for (const key of setHeaders.keys())
|
|
184
179
|
if (key === "set-cookie") {
|