@sveltejs/adapter-netlify 1.0.0-next.46 → 1.0.0-next.47
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/README.md +0 -1
- package/files/cjs/handler.js +30 -29
- package/files/esm/handler.js +30 -29
- package/package.json +5 -3
package/README.md
CHANGED
package/files/cjs/handler.js
CHANGED
|
@@ -12,6 +12,36 @@ require('node:util');
|
|
|
12
12
|
require('node:url');
|
|
13
13
|
require('net');
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Splits headers into two categories: single value and multi value
|
|
17
|
+
* @param {Headers} headers
|
|
18
|
+
* @returns {{
|
|
19
|
+
* headers: Record<string, string>,
|
|
20
|
+
* multiValueHeaders: Record<string, string[]>
|
|
21
|
+
* }}
|
|
22
|
+
*/
|
|
23
|
+
function split_headers(headers) {
|
|
24
|
+
/** @type {Record<string, string>} */
|
|
25
|
+
const h = {};
|
|
26
|
+
|
|
27
|
+
/** @type {Record<string, string[]>} */
|
|
28
|
+
const m = {};
|
|
29
|
+
|
|
30
|
+
headers.forEach((value, key) => {
|
|
31
|
+
if (key === 'set-cookie') {
|
|
32
|
+
// @ts-expect-error (headers.raw() is non-standard)
|
|
33
|
+
m[key] = headers.raw()[key];
|
|
34
|
+
} else {
|
|
35
|
+
h[key] = value;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
headers: h,
|
|
41
|
+
multiValueHeaders: m
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
15
45
|
/**
|
|
16
46
|
* @param {import('@sveltejs/kit').SSRManifest} manifest
|
|
17
47
|
* @returns {import('@netlify/functions').Handler}
|
|
@@ -67,33 +97,4 @@ function to_request(event) {
|
|
|
67
97
|
return new Request(rawUrl, init);
|
|
68
98
|
}
|
|
69
99
|
|
|
70
|
-
/**
|
|
71
|
-
* Splits headers into two categories: single value and multi value
|
|
72
|
-
* @param {Headers} headers
|
|
73
|
-
* @returns {{
|
|
74
|
-
* headers: Record<string, string>,
|
|
75
|
-
* multiValueHeaders: Record<string, string[]>
|
|
76
|
-
* }}
|
|
77
|
-
*/
|
|
78
|
-
function split_headers(headers) {
|
|
79
|
-
/** @type {Record<string, string>} */
|
|
80
|
-
const h = {};
|
|
81
|
-
|
|
82
|
-
/** @type {Record<string, string[]>} */
|
|
83
|
-
const m = {};
|
|
84
|
-
|
|
85
|
-
headers.forEach((value, key) => {
|
|
86
|
-
if (key === 'set-cookie') {
|
|
87
|
-
m[key] = value.split(', ');
|
|
88
|
-
} else {
|
|
89
|
-
h[key] = value;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
return {
|
|
94
|
-
headers: h,
|
|
95
|
-
multiValueHeaders: m
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
100
|
exports.init = init;
|
package/files/esm/handler.js
CHANGED
|
@@ -8,6 +8,36 @@ import 'node:util';
|
|
|
8
8
|
import 'node:url';
|
|
9
9
|
import 'net';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Splits headers into two categories: single value and multi value
|
|
13
|
+
* @param {Headers} headers
|
|
14
|
+
* @returns {{
|
|
15
|
+
* headers: Record<string, string>,
|
|
16
|
+
* multiValueHeaders: Record<string, string[]>
|
|
17
|
+
* }}
|
|
18
|
+
*/
|
|
19
|
+
function split_headers(headers) {
|
|
20
|
+
/** @type {Record<string, string>} */
|
|
21
|
+
const h = {};
|
|
22
|
+
|
|
23
|
+
/** @type {Record<string, string[]>} */
|
|
24
|
+
const m = {};
|
|
25
|
+
|
|
26
|
+
headers.forEach((value, key) => {
|
|
27
|
+
if (key === 'set-cookie') {
|
|
28
|
+
// @ts-expect-error (headers.raw() is non-standard)
|
|
29
|
+
m[key] = headers.raw()[key];
|
|
30
|
+
} else {
|
|
31
|
+
h[key] = value;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
headers: h,
|
|
37
|
+
multiValueHeaders: m
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
11
41
|
/**
|
|
12
42
|
* @param {import('@sveltejs/kit').SSRManifest} manifest
|
|
13
43
|
* @returns {import('@netlify/functions').Handler}
|
|
@@ -63,33 +93,4 @@ function to_request(event) {
|
|
|
63
93
|
return new Request(rawUrl, init);
|
|
64
94
|
}
|
|
65
95
|
|
|
66
|
-
/**
|
|
67
|
-
* Splits headers into two categories: single value and multi value
|
|
68
|
-
* @param {Headers} headers
|
|
69
|
-
* @returns {{
|
|
70
|
-
* headers: Record<string, string>,
|
|
71
|
-
* multiValueHeaders: Record<string, string[]>
|
|
72
|
-
* }}
|
|
73
|
-
*/
|
|
74
|
-
function split_headers(headers) {
|
|
75
|
-
/** @type {Record<string, string>} */
|
|
76
|
-
const h = {};
|
|
77
|
-
|
|
78
|
-
/** @type {Record<string, string[]>} */
|
|
79
|
-
const m = {};
|
|
80
|
-
|
|
81
|
-
headers.forEach((value, key) => {
|
|
82
|
-
if (key === 'set-cookie') {
|
|
83
|
-
m[key] = value.split(', ');
|
|
84
|
-
} else {
|
|
85
|
-
h[key] = value;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
return {
|
|
90
|
-
headers: h,
|
|
91
|
-
multiValueHeaders: m
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
96
|
export { init };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-netlify",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.47",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/sveltejs/kit",
|
|
@@ -31,13 +31,15 @@
|
|
|
31
31
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
32
32
|
"@rollup/plugin-json": "^4.1.0",
|
|
33
33
|
"@rollup/plugin-node-resolve": "^13.0.5",
|
|
34
|
-
"@sveltejs/kit": "1.0.0-next.
|
|
34
|
+
"@sveltejs/kit": "1.0.0-next.286",
|
|
35
35
|
"rimraf": "^3.0.2",
|
|
36
|
-
"rollup": "^2.58.0"
|
|
36
|
+
"rollup": "^2.58.0",
|
|
37
|
+
"uvu": "^0.5.2"
|
|
37
38
|
},
|
|
38
39
|
"scripts": {
|
|
39
40
|
"dev": "rimraf files && rollup -cw",
|
|
40
41
|
"build": "rimraf files && rollup -c",
|
|
42
|
+
"test": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\"",
|
|
41
43
|
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,svelte}\" && npm run check-format",
|
|
42
44
|
"format": "npm run check-format -- --write",
|
|
43
45
|
"check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore"
|