@jay-framework/dev-server 0.16.3 → 0.16.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.js +25 -1
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -1880,6 +1880,26 @@ function getStatusCodeForError(code, isActionError) {
|
|
|
1880
1880
|
}
|
|
1881
1881
|
const DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
1882
1882
|
const DEFAULT_MAX_FILES = 10;
|
|
1883
|
+
function mergeDottedMultipartKeys(body) {
|
|
1884
|
+
const keys = Object.keys(body);
|
|
1885
|
+
for (const key of keys) {
|
|
1886
|
+
if (!key.includes("."))
|
|
1887
|
+
continue;
|
|
1888
|
+
const val = body[key];
|
|
1889
|
+
delete body[key];
|
|
1890
|
+
const parts = key.split(".");
|
|
1891
|
+
let cur = body;
|
|
1892
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
1893
|
+
const p = parts[i];
|
|
1894
|
+
const next = cur[p];
|
|
1895
|
+
if (typeof next !== "object" || next === null || Array.isArray(next)) {
|
|
1896
|
+
cur[p] = {};
|
|
1897
|
+
}
|
|
1898
|
+
cur = cur[p];
|
|
1899
|
+
}
|
|
1900
|
+
cur[parts[parts.length - 1]] = val;
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1883
1903
|
function parseMultipart(req, tempDir, maxFileSize, maxFiles) {
|
|
1884
1904
|
return new Promise((resolve, reject) => {
|
|
1885
1905
|
fs$1.mkdirSync(tempDir, { recursive: true });
|
|
@@ -1958,7 +1978,11 @@ function parseMultipart(req, tempDir, maxFileSize, maxFiles) {
|
|
|
1958
1978
|
bb.on("close", () => {
|
|
1959
1979
|
if (errored)
|
|
1960
1980
|
return;
|
|
1961
|
-
Promise.all(pendingWrites).then(() =>
|
|
1981
|
+
Promise.all(pendingWrites).then(() => {
|
|
1982
|
+
const body = { ...jsonData, ...files };
|
|
1983
|
+
mergeDottedMultipartKeys(body);
|
|
1984
|
+
resolve({ body, tempDir });
|
|
1985
|
+
}).catch((err) => reject(err));
|
|
1962
1986
|
});
|
|
1963
1987
|
bb.on("error", (err) => {
|
|
1964
1988
|
if (!errored) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/dev-server",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,23 +23,23 @@
|
|
|
23
23
|
"test:watch": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@jay-framework/compiler-jay-stack": "^0.16.
|
|
27
|
-
"@jay-framework/compiler-shared": "^0.16.
|
|
28
|
-
"@jay-framework/component": "^0.16.
|
|
29
|
-
"@jay-framework/fullstack-component": "^0.16.
|
|
30
|
-
"@jay-framework/logger": "^0.16.
|
|
31
|
-
"@jay-framework/runtime": "^0.16.
|
|
32
|
-
"@jay-framework/stack-client-runtime": "^0.16.
|
|
33
|
-
"@jay-framework/stack-route-scanner": "^0.16.
|
|
34
|
-
"@jay-framework/stack-server-runtime": "^0.16.
|
|
35
|
-
"@jay-framework/view-state-merge": "^0.16.
|
|
26
|
+
"@jay-framework/compiler-jay-stack": "^0.16.4",
|
|
27
|
+
"@jay-framework/compiler-shared": "^0.16.4",
|
|
28
|
+
"@jay-framework/component": "^0.16.4",
|
|
29
|
+
"@jay-framework/fullstack-component": "^0.16.4",
|
|
30
|
+
"@jay-framework/logger": "^0.16.4",
|
|
31
|
+
"@jay-framework/runtime": "^0.16.4",
|
|
32
|
+
"@jay-framework/stack-client-runtime": "^0.16.4",
|
|
33
|
+
"@jay-framework/stack-route-scanner": "^0.16.4",
|
|
34
|
+
"@jay-framework/stack-server-runtime": "^0.16.4",
|
|
35
|
+
"@jay-framework/view-state-merge": "^0.16.4",
|
|
36
36
|
"busboy": "^1.6.0",
|
|
37
37
|
"vite": "^5.0.11"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@jay-framework/dev-environment": "^0.16.
|
|
41
|
-
"@jay-framework/jay-cli": "^0.16.
|
|
42
|
-
"@jay-framework/stack-client-runtime": "^0.16.
|
|
40
|
+
"@jay-framework/dev-environment": "^0.16.4",
|
|
41
|
+
"@jay-framework/jay-cli": "^0.16.4",
|
|
42
|
+
"@jay-framework/stack-client-runtime": "^0.16.4",
|
|
43
43
|
"@playwright/test": "^1.58.2",
|
|
44
44
|
"@types/busboy": "^1.5.4",
|
|
45
45
|
"@types/express": "^5.0.2",
|