@trpc/server 11.0.0-rc.445 → 11.0.0-rc.449
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/adapters/next-app-dir/nextAppDirCaller.d.ts.map +1 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.js +1 -1
- package/dist/adapters/next-app-dir/nextAppDirCaller.mjs +1 -1
- package/dist/adapters/ws.js +1 -1
- package/dist/adapters/ws.mjs +1 -1
- package/dist/bundle-analysis.json +52 -51
- package/dist/unstable-core-do-not-import/http/formDataToObject.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/http/formDataToObject.js +40 -0
- package/dist/unstable-core-do-not-import/http/formDataToObject.mjs +38 -0
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +1 -1
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import.d.ts +2 -1
- package/dist/unstable-core-do-not-import.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import.js +5 -3
- package/dist/unstable-core-do-not-import.mjs +2 -1
- package/package.json +3 -3
- package/src/adapters/next-app-dir/nextAppDirCaller.ts +2 -1
- package/src/{adapters/next-app-dir → unstable-core-do-not-import/http}/formDataToObject.ts +18 -10
- package/src/unstable-core-do-not-import/rootConfig.ts +1 -1
- package/src/unstable-core-do-not-import.ts +2 -1
- package/dist/adapters/next-app-dir/formDataToObject.d.ts.map +0 -1
- package/dist/adapters/next-app-dir/formDataToObject.js +0 -34
- package/dist/adapters/next-app-dir/formDataToObject.mjs +0 -32
- /package/dist/{adapters/next-app-dir → unstable-core-do-not-import/http}/formDataToObject.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextAppDirCaller.d.ts","sourceRoot":"","sources":["../../../src/adapters/next-app-dir/nextAppDirCaller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"nextAppDirCaller.d.ts","sourceRoot":"","sources":["../../../src/adapters/next-app-dir/nextAppDirCaller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAMhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAGvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAC;AAGzF,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACT,MAAM,yCAAyC,CAAC;AAIjD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAC9C,MAAM,EAAE,QAAQ,CACd;IACE;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,KAAK,MAAM,CAAC;IAClD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CACzD,GAAG,qBAAqB,CAAC,QAAQ,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC,CAClE,GACA,cAAc,CAAC,QAAQ,CAAC,CAyF1B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var TRPCError = require('../../unstable-core-do-not-import/error/TRPCError.js');
|
|
4
|
+
var formDataToObject = require('../../unstable-core-do-not-import/http/formDataToObject.js');
|
|
4
5
|
require('../../unstable-core-do-not-import/rootConfig.js');
|
|
5
|
-
var formDataToObject = require('./formDataToObject.js');
|
|
6
6
|
var redirect = require('./redirect.js');
|
|
7
7
|
var rethrowNextErrors = require('./rethrowNextErrors.js');
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TRPCError, getTRPCErrorFromUnknown } from '../../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
2
|
+
import { formDataToObject } from '../../unstable-core-do-not-import/http/formDataToObject.mjs';
|
|
2
3
|
import '../../unstable-core-do-not-import/rootConfig.mjs';
|
|
3
|
-
import { formDataToObject } from './formDataToObject.mjs';
|
|
4
4
|
import { TRPCRedirectError } from './redirect.mjs';
|
|
5
5
|
import { rethrowNextErrors } from './rethrowNextErrors.mjs';
|
|
6
6
|
|
package/dist/adapters/ws.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var getErrorShape = require('../unstable-core-do-not-import/error/getErrorShape.js');
|
|
4
4
|
var TRPCError = require('../unstable-core-do-not-import/error/TRPCError.js');
|
|
5
|
-
var parseConnectionParams = require('../unstable-core-do-not-import/http/parseConnectionParams.js');
|
|
6
5
|
var utils = require('../unstable-core-do-not-import/utils.js');
|
|
6
|
+
var parseConnectionParams = require('../unstable-core-do-not-import/http/parseConnectionParams.js');
|
|
7
7
|
var parseTRPCMessage = require('../unstable-core-do-not-import/rpc/parseTRPCMessage.js');
|
|
8
8
|
var observable = require('../observable/observable.js');
|
|
9
9
|
var transformer = require('../unstable-core-do-not-import/transformer.js');
|
package/dist/adapters/ws.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getErrorShape } from '../unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
2
2
|
import { TRPCError, getTRPCErrorFromUnknown } from '../unstable-core-do-not-import/error/TRPCError.mjs';
|
|
3
|
-
import { parseConnectionParamsFromUnknown } from '../unstable-core-do-not-import/http/parseConnectionParams.mjs';
|
|
4
3
|
import { run, isAsyncIterable, isObject } from '../unstable-core-do-not-import/utils.mjs';
|
|
4
|
+
import { parseConnectionParamsFromUnknown } from '../unstable-core-do-not-import/http/parseConnectionParams.mjs';
|
|
5
5
|
import { parseTRPCMessage } from '../unstable-core-do-not-import/rpc/parseTRPCMessage.mjs';
|
|
6
6
|
import { isObservable, observableToAsyncIterable } from '../observable/observable.mjs';
|
|
7
7
|
import { transformTRPCResponse } from '../unstable-core-do-not-import/transformer.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 27.
|
|
2
|
+
"bundleSize": 129790,
|
|
3
|
+
"bundleOrigSize": 179497,
|
|
4
|
+
"bundleReduction": 27.69,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependents": [
|
|
15
15
|
"/src/unstable-core-do-not-import.ts"
|
|
16
16
|
],
|
|
17
|
-
"percent": 13.
|
|
17
|
+
"percent": 13.16,
|
|
18
18
|
"reduction": 0
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"/src/unstable-core-do-not-import.ts",
|
|
32
32
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
33
33
|
],
|
|
34
|
-
"percent": 12.
|
|
34
|
+
"percent": 12.08,
|
|
35
35
|
"reduction": 6.72
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependents": [
|
|
47
47
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
48
48
|
],
|
|
49
|
-
"percent": 11
|
|
49
|
+
"percent": 11,
|
|
50
50
|
"reduction": 0
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"/src/unstable-core-do-not-import.ts",
|
|
62
62
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
63
63
|
],
|
|
64
|
-
"percent": 5.
|
|
64
|
+
"percent": 5.85,
|
|
65
65
|
"reduction": 0
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"/src/unstable-core-do-not-import.ts",
|
|
80
80
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
81
81
|
],
|
|
82
|
-
"percent": 4.
|
|
82
|
+
"percent": 4.92,
|
|
83
83
|
"reduction": 39.77
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"/src/unstable-core-do-not-import.ts",
|
|
95
95
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
96
96
|
],
|
|
97
|
-
"percent": 4.
|
|
97
|
+
"percent": 4.87,
|
|
98
98
|
"reduction": 60.06
|
|
99
99
|
},
|
|
100
100
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"/src/unstable-core-do-not-import.ts",
|
|
114
114
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
115
115
|
],
|
|
116
|
-
"percent": 4.
|
|
116
|
+
"percent": 4.34,
|
|
117
117
|
"reduction": 24.48
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"dependents": [
|
|
128
128
|
"/src/adapters/aws-lambda/index.ts"
|
|
129
129
|
],
|
|
130
|
-
"percent": 4.
|
|
130
|
+
"percent": 4.17,
|
|
131
131
|
"reduction": 11.38
|
|
132
132
|
},
|
|
133
133
|
{
|
|
@@ -147,13 +147,13 @@
|
|
|
147
147
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
148
148
|
"/src/observable/operators.ts"
|
|
149
149
|
],
|
|
150
|
-
"percent": 3.
|
|
150
|
+
"percent": 3.45,
|
|
151
151
|
"reduction": 0
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
"id": "/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
155
155
|
"size": 3135,
|
|
156
|
-
"origSize":
|
|
156
|
+
"origSize": 4098,
|
|
157
157
|
"renderedExports": [
|
|
158
158
|
"nextAppDirCaller"
|
|
159
159
|
],
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"/src/adapters/next-app-dir.ts"
|
|
163
163
|
],
|
|
164
164
|
"percent": 2.42,
|
|
165
|
-
"reduction":
|
|
165
|
+
"reduction": 23.5
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
"id": "/src/observable/operators.ts",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"dependents": [
|
|
178
178
|
"/src/observable/index.ts"
|
|
179
179
|
],
|
|
180
|
-
"percent": 2.
|
|
180
|
+
"percent": 2.12,
|
|
181
181
|
"reduction": 0
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
198
198
|
"/src/unstable-core-do-not-import/router.ts"
|
|
199
199
|
],
|
|
200
|
-
"percent": 2.
|
|
200
|
+
"percent": 2.11,
|
|
201
201
|
"reduction": 45.94
|
|
202
202
|
},
|
|
203
203
|
{
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"dependents": [
|
|
212
212
|
"/src/unstable-core-do-not-import.ts"
|
|
213
213
|
],
|
|
214
|
-
"percent": 2.
|
|
214
|
+
"percent": 2.08,
|
|
215
215
|
"reduction": 40.91
|
|
216
216
|
},
|
|
217
217
|
{
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
246
246
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
247
247
|
],
|
|
248
|
-
"percent": 2.
|
|
248
|
+
"percent": 2.02,
|
|
249
249
|
"reduction": 55.5
|
|
250
250
|
},
|
|
251
251
|
{
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
"/src/unstable-core-do-not-import.ts",
|
|
262
262
|
"/src/unstable-core-do-not-import/router.ts"
|
|
263
263
|
],
|
|
264
|
-
"percent": 1.
|
|
264
|
+
"percent": 1.79,
|
|
265
265
|
"reduction": 0
|
|
266
266
|
},
|
|
267
267
|
{
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
],
|
|
366
366
|
"removedExports": [],
|
|
367
367
|
"dependents": [],
|
|
368
|
-
"percent": 1.
|
|
368
|
+
"percent": 1.17,
|
|
369
369
|
"reduction": 27.6
|
|
370
370
|
},
|
|
371
371
|
{
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
429
429
|
"/src/unstable-core-do-not-import/stream/jsonl.ts"
|
|
430
430
|
],
|
|
431
|
-
"percent": 0.
|
|
431
|
+
"percent": 0.92,
|
|
432
432
|
"reduction": 28.12
|
|
433
433
|
},
|
|
434
434
|
{
|
|
@@ -462,6 +462,20 @@
|
|
|
462
462
|
"percent": 0.85,
|
|
463
463
|
"reduction": 15.08
|
|
464
464
|
},
|
|
465
|
+
{
|
|
466
|
+
"id": "/src/unstable-core-do-not-import/http/formDataToObject.ts",
|
|
467
|
+
"size": 1060,
|
|
468
|
+
"origSize": 1047,
|
|
469
|
+
"renderedExports": [
|
|
470
|
+
"formDataToObject"
|
|
471
|
+
],
|
|
472
|
+
"removedExports": [],
|
|
473
|
+
"dependents": [
|
|
474
|
+
"/src/unstable-core-do-not-import.ts"
|
|
475
|
+
],
|
|
476
|
+
"percent": 0.82,
|
|
477
|
+
"reduction": 0
|
|
478
|
+
},
|
|
465
479
|
{
|
|
466
480
|
"id": "/src/unstable-core-do-not-import/parser.ts",
|
|
467
481
|
"size": 1034,
|
|
@@ -511,20 +525,6 @@
|
|
|
511
525
|
"percent": 0.76,
|
|
512
526
|
"reduction": 15.69
|
|
513
527
|
},
|
|
514
|
-
{
|
|
515
|
-
"id": "/src/adapters/next-app-dir/formDataToObject.ts",
|
|
516
|
-
"size": 818,
|
|
517
|
-
"origSize": 826,
|
|
518
|
-
"renderedExports": [
|
|
519
|
-
"formDataToObject"
|
|
520
|
-
],
|
|
521
|
-
"removedExports": [],
|
|
522
|
-
"dependents": [
|
|
523
|
-
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
524
|
-
],
|
|
525
|
-
"percent": 0.63,
|
|
526
|
-
"reduction": 0.97
|
|
527
|
-
},
|
|
528
528
|
{
|
|
529
529
|
"id": "/src/adapters/aws-lambda/index.ts",
|
|
530
530
|
"size": 759,
|
|
@@ -534,7 +534,7 @@
|
|
|
534
534
|
],
|
|
535
535
|
"removedExports": [],
|
|
536
536
|
"dependents": [],
|
|
537
|
-
"percent": 0.
|
|
537
|
+
"percent": 0.58,
|
|
538
538
|
"reduction": 66.9
|
|
539
539
|
},
|
|
540
540
|
{
|
|
@@ -597,7 +597,7 @@
|
|
|
597
597
|
{
|
|
598
598
|
"id": "/src/unstable-core-do-not-import/rootConfig.ts",
|
|
599
599
|
"size": 343,
|
|
600
|
-
"origSize":
|
|
600
|
+
"origSize": 3235,
|
|
601
601
|
"renderedExports": [
|
|
602
602
|
"isServerDefault"
|
|
603
603
|
],
|
|
@@ -607,7 +607,7 @@
|
|
|
607
607
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
608
608
|
],
|
|
609
609
|
"percent": 0.26,
|
|
610
|
-
"reduction": 89.
|
|
610
|
+
"reduction": 89.4
|
|
611
611
|
},
|
|
612
612
|
{
|
|
613
613
|
"id": "/src/adapters/express.ts",
|
|
@@ -753,11 +753,12 @@
|
|
|
753
753
|
{
|
|
754
754
|
"id": "/src/unstable-core-do-not-import.ts",
|
|
755
755
|
"size": 0,
|
|
756
|
-
"origSize":
|
|
756
|
+
"origSize": 2169,
|
|
757
757
|
"renderedExports": [],
|
|
758
758
|
"removedExports": [],
|
|
759
759
|
"dependents": [
|
|
760
|
-
"/src/adapters/ws.ts"
|
|
760
|
+
"/src/adapters/ws.ts",
|
|
761
|
+
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
761
762
|
],
|
|
762
763
|
"percent": 0,
|
|
763
764
|
"reduction": 100
|
|
@@ -795,27 +796,27 @@
|
|
|
795
796
|
"reduction": 100
|
|
796
797
|
},
|
|
797
798
|
{
|
|
798
|
-
"id": "/src/adapters/
|
|
799
|
+
"id": "/src/adapters/fetch/index.ts",
|
|
799
800
|
"size": 0,
|
|
800
|
-
"origSize":
|
|
801
|
+
"origSize": 64,
|
|
801
802
|
"renderedExports": [],
|
|
802
803
|
"removedExports": [],
|
|
803
|
-
"dependents": [
|
|
804
|
-
"/src/adapters/express.ts",
|
|
805
|
-
"/src/adapters/next.ts",
|
|
806
|
-
"/src/adapters/standalone.ts",
|
|
807
|
-
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
808
|
-
],
|
|
804
|
+
"dependents": [],
|
|
809
805
|
"percent": 0,
|
|
810
806
|
"reduction": 100
|
|
811
807
|
},
|
|
812
808
|
{
|
|
813
|
-
"id": "/src/adapters/
|
|
809
|
+
"id": "/src/adapters/node-http/index.ts",
|
|
814
810
|
"size": 0,
|
|
815
|
-
"origSize":
|
|
811
|
+
"origSize": 111,
|
|
816
812
|
"renderedExports": [],
|
|
817
813
|
"removedExports": [],
|
|
818
|
-
"dependents": [
|
|
814
|
+
"dependents": [
|
|
815
|
+
"/src/adapters/next.ts",
|
|
816
|
+
"/src/adapters/express.ts",
|
|
817
|
+
"/src/adapters/standalone.ts",
|
|
818
|
+
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
819
|
+
],
|
|
819
820
|
"percent": 0,
|
|
820
821
|
"reduction": 100
|
|
821
822
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formDataToObject.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/formDataToObject.ts"],"names":[],"mappings":"AAkCA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,2BASlD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */ const isNumberString = (str)=>/^\d+$/.test(str);
|
|
4
|
+
function set(obj, path, value) {
|
|
5
|
+
if (path.length > 1) {
|
|
6
|
+
const newPath = [
|
|
7
|
+
...path
|
|
8
|
+
];
|
|
9
|
+
const key = newPath.shift();
|
|
10
|
+
const nextKey = newPath[0];
|
|
11
|
+
if (!obj[key]) {
|
|
12
|
+
obj[key] = isNumberString(nextKey) ? [] : {};
|
|
13
|
+
} else if (Array.isArray(obj[key]) && !isNumberString(nextKey)) {
|
|
14
|
+
obj[key] = Object.fromEntries(Object.entries(obj[key]));
|
|
15
|
+
}
|
|
16
|
+
set(obj[key], newPath, value);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const p = path[0];
|
|
20
|
+
if (obj[p] === undefined) {
|
|
21
|
+
obj[p] = value;
|
|
22
|
+
} else if (Array.isArray(obj[p])) {
|
|
23
|
+
obj[p].push(value);
|
|
24
|
+
} else {
|
|
25
|
+
obj[p] = [
|
|
26
|
+
obj[p],
|
|
27
|
+
value
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function formDataToObject(formData) {
|
|
32
|
+
const obj = {};
|
|
33
|
+
for (const [key, value] of formData.entries()){
|
|
34
|
+
const parts = key.split(/[\.\[\]]/).filter(Boolean);
|
|
35
|
+
set(obj, parts, value);
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
exports.formDataToObject = formDataToObject;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */ const isNumberString = (str)=>/^\d+$/.test(str);
|
|
2
|
+
function set(obj, path, value) {
|
|
3
|
+
if (path.length > 1) {
|
|
4
|
+
const newPath = [
|
|
5
|
+
...path
|
|
6
|
+
];
|
|
7
|
+
const key = newPath.shift();
|
|
8
|
+
const nextKey = newPath[0];
|
|
9
|
+
if (!obj[key]) {
|
|
10
|
+
obj[key] = isNumberString(nextKey) ? [] : {};
|
|
11
|
+
} else if (Array.isArray(obj[key]) && !isNumberString(nextKey)) {
|
|
12
|
+
obj[key] = Object.fromEntries(Object.entries(obj[key]));
|
|
13
|
+
}
|
|
14
|
+
set(obj[key], newPath, value);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const p = path[0];
|
|
18
|
+
if (obj[p] === undefined) {
|
|
19
|
+
obj[p] = value;
|
|
20
|
+
} else if (Array.isArray(obj[p])) {
|
|
21
|
+
obj[p].push(value);
|
|
22
|
+
} else {
|
|
23
|
+
obj[p] = [
|
|
24
|
+
obj[p],
|
|
25
|
+
value
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function formDataToObject(formData) {
|
|
30
|
+
const obj = {};
|
|
31
|
+
for (const [key, value] of formData.entries()){
|
|
32
|
+
const parts = key.split(/[\.\[\]]/).filter(Boolean);
|
|
33
|
+
set(obj, parts, value);
|
|
34
|
+
}
|
|
35
|
+
return obj;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { formDataToObject };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootConfig.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/rootConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAMmB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,SAAS;IAClD;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,uBAAuB,CAAC;IACrC;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAErE,YAAY,CAAC,EAAE;QACb;;;WAGG;QACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC;;WAEG;QACH,gBAAgB,CAAC,EAAE;YACjB;;;eAGG;YACH,OAAO,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"rootConfig.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/rootConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAMmB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,MAAM,SAAS,SAAS;IAClD;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,uBAAuB,CAAC;IACrC;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IACpE;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAErE,YAAY,CAAC,EAAE;QACb;;;WAGG;QACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC;;WAEG;QACH,gBAAgB,CAAC,EAAE;YACjB;;;eAGG;YACH,OAAO,CAAC,EAAE,OAAO,CAAC;SACnB,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC;KACvE,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,SAAS,IAAI,SAAS,CAAC;AAErE,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;IACzC,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,GAAG,CAAC;IACV,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,EAAE,GAAG,CAAC;CAClB,CAAC,CAAC;AAEH,KAAK,SAAS,CAAC,UAAU,SAAS,OAAO,EAAE,KAAK,IAAI,UAAU,SAAS,IAAI,GACvE,OAAO,CAAC,KAAK,CAAC,GACd,KAAK,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAC/B,QAAQ,EACR,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IACvC,SAAS,CACX,MAAM,SAAS,QAAQ,GAAG,IAAI,GAAG,KAAK,EACtC;IACE;;QAEI;IACJ,aAAa,EAAE,SAAS,CAAC;CAC1B,CACF,CAAC"}
|
|
@@ -16,10 +16,11 @@ export * from './unstable-core-do-not-import/error/formatter';
|
|
|
16
16
|
export * from './unstable-core-do-not-import/error/getErrorShape';
|
|
17
17
|
export * from './unstable-core-do-not-import/error/TRPCError';
|
|
18
18
|
export * from './unstable-core-do-not-import/http/batchStreamFormatter';
|
|
19
|
-
export * from './unstable-core-do-not-import/http/parseConnectionParams';
|
|
20
19
|
export * from './unstable-core-do-not-import/http/contentType';
|
|
21
20
|
export * from './unstable-core-do-not-import/http/contentTypeParsers';
|
|
21
|
+
export * from './unstable-core-do-not-import/http/formDataToObject';
|
|
22
22
|
export * from './unstable-core-do-not-import/http/getHTTPStatusCode';
|
|
23
|
+
export * from './unstable-core-do-not-import/http/parseConnectionParams';
|
|
23
24
|
export * from './unstable-core-do-not-import/http/resolveResponse';
|
|
24
25
|
export * from './unstable-core-do-not-import/http/toURL';
|
|
25
26
|
export * from './unstable-core-do-not-import/http/types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unstable-core-do-not-import.d.ts","sourceRoot":"","sources":["../src/unstable-core-do-not-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yDAAyD,CAAC;AACxE,cAAc,
|
|
1
|
+
{"version":3,"file":"unstable-core-do-not-import.d.ts","sourceRoot":"","sources":["../src/unstable-core-do-not-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yDAAyD,CAAC;AACxE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,0DAA0D,CAAC;AACzE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC"}
|
|
@@ -5,10 +5,11 @@ var formatter = require('./unstable-core-do-not-import/error/formatter.js');
|
|
|
5
5
|
var getErrorShape = require('./unstable-core-do-not-import/error/getErrorShape.js');
|
|
6
6
|
var TRPCError = require('./unstable-core-do-not-import/error/TRPCError.js');
|
|
7
7
|
var batchStreamFormatter = require('./unstable-core-do-not-import/http/batchStreamFormatter.js');
|
|
8
|
-
var parseConnectionParams = require('./unstable-core-do-not-import/http/parseConnectionParams.js');
|
|
9
8
|
var contentType = require('./unstable-core-do-not-import/http/contentType.js');
|
|
10
9
|
var contentTypeParsers = require('./unstable-core-do-not-import/http/contentTypeParsers.js');
|
|
10
|
+
var formDataToObject = require('./unstable-core-do-not-import/http/formDataToObject.js');
|
|
11
11
|
var getHTTPStatusCode = require('./unstable-core-do-not-import/http/getHTTPStatusCode.js');
|
|
12
|
+
var parseConnectionParams = require('./unstable-core-do-not-import/http/parseConnectionParams.js');
|
|
12
13
|
var resolveResponse = require('./unstable-core-do-not-import/http/resolveResponse.js');
|
|
13
14
|
var toURL = require('./unstable-core-do-not-import/http/toURL.js');
|
|
14
15
|
var initTRPC = require('./unstable-core-do-not-import/initTRPC.js');
|
|
@@ -36,12 +37,13 @@ exports.TRPCError = TRPCError.TRPCError;
|
|
|
36
37
|
exports.getCauseFromUnknown = TRPCError.getCauseFromUnknown;
|
|
37
38
|
exports.getTRPCErrorFromUnknown = TRPCError.getTRPCErrorFromUnknown;
|
|
38
39
|
exports.getBatchStreamFormatter = batchStreamFormatter.getBatchStreamFormatter;
|
|
39
|
-
exports.parseConnectionParamsFromString = parseConnectionParams.parseConnectionParamsFromString;
|
|
40
|
-
exports.parseConnectionParamsFromUnknown = parseConnectionParams.parseConnectionParamsFromUnknown;
|
|
41
40
|
exports.getRequestInfo = contentType.getRequestInfo;
|
|
42
41
|
exports.octetInputParser = contentTypeParsers.octetInputParser;
|
|
42
|
+
exports.formDataToObject = formDataToObject.formDataToObject;
|
|
43
43
|
exports.getHTTPStatusCode = getHTTPStatusCode.getHTTPStatusCode;
|
|
44
44
|
exports.getHTTPStatusCodeFromError = getHTTPStatusCode.getHTTPStatusCodeFromError;
|
|
45
|
+
exports.parseConnectionParamsFromString = parseConnectionParams.parseConnectionParamsFromString;
|
|
46
|
+
exports.parseConnectionParamsFromUnknown = parseConnectionParams.parseConnectionParamsFromUnknown;
|
|
45
47
|
exports.resolveResponse = resolveResponse.resolveResponse;
|
|
46
48
|
exports.toURL = toURL.toURL;
|
|
47
49
|
exports.initTRPC = initTRPC.initTRPC;
|
|
@@ -3,10 +3,11 @@ export { defaultFormatter } from './unstable-core-do-not-import/error/formatter.
|
|
|
3
3
|
export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
4
4
|
export { TRPCError, getCauseFromUnknown, getTRPCErrorFromUnknown } from './unstable-core-do-not-import/error/TRPCError.mjs';
|
|
5
5
|
export { getBatchStreamFormatter } from './unstable-core-do-not-import/http/batchStreamFormatter.mjs';
|
|
6
|
-
export { parseConnectionParamsFromString, parseConnectionParamsFromUnknown } from './unstable-core-do-not-import/http/parseConnectionParams.mjs';
|
|
7
6
|
export { getRequestInfo } from './unstable-core-do-not-import/http/contentType.mjs';
|
|
8
7
|
export { octetInputParser } from './unstable-core-do-not-import/http/contentTypeParsers.mjs';
|
|
8
|
+
export { formDataToObject } from './unstable-core-do-not-import/http/formDataToObject.mjs';
|
|
9
9
|
export { getHTTPStatusCode, getHTTPStatusCodeFromError } from './unstable-core-do-not-import/http/getHTTPStatusCode.mjs';
|
|
10
|
+
export { parseConnectionParamsFromString, parseConnectionParamsFromUnknown } from './unstable-core-do-not-import/http/parseConnectionParams.mjs';
|
|
10
11
|
export { resolveResponse } from './unstable-core-do-not-import/http/resolveResponse.mjs';
|
|
11
12
|
export { toURL } from './unstable-core-do-not-import/http/toURL.mjs';
|
|
12
13
|
export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.449+42acce6ac",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"tslib": "^2.5.0",
|
|
142
142
|
"tsx": "^4.0.0",
|
|
143
143
|
"typescript": "^5.5.0",
|
|
144
|
-
"valibot": "^0.
|
|
144
|
+
"valibot": "^0.36.0",
|
|
145
145
|
"ws": "^8.0.0",
|
|
146
146
|
"yup": "^1.0.0",
|
|
147
147
|
"zod": "^3.0.0"
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"funding": [
|
|
150
150
|
"https://trpc.io/sponsor"
|
|
151
151
|
],
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "42acce6ac165dd489ebc11721e1c4dd15f4d8b7a"
|
|
153
153
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CreateContextCallback } from '../../@trpc/server';
|
|
2
2
|
import { getTRPCErrorFromUnknown, TRPCError } from '../../@trpc/server';
|
|
3
|
+
// eslint-disable-next-line no-restricted-imports
|
|
4
|
+
import { formDataToObject } from '../../unstable-core-do-not-import';
|
|
3
5
|
// FIXME: fix lint rule, this is ok
|
|
4
6
|
// eslint-disable-next-line no-restricted-imports
|
|
5
7
|
import type { ErrorHandlerOptions } from '../../unstable-core-do-not-import/procedure';
|
|
@@ -12,7 +14,6 @@ import type {
|
|
|
12
14
|
MaybePromise,
|
|
13
15
|
Simplify,
|
|
14
16
|
} from '../../unstable-core-do-not-import/types';
|
|
15
|
-
import { formDataToObject } from './formDataToObject';
|
|
16
17
|
import { TRPCRedirectError } from './redirect';
|
|
17
18
|
import { rethrowNextErrors } from './rethrowNextErrors';
|
|
18
19
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
+
|
|
3
|
+
const isNumberString = (str: string) => /^\d+$/.test(str);
|
|
4
|
+
|
|
2
5
|
function set(
|
|
3
6
|
obj: Record<string, any>,
|
|
4
|
-
path: string[]
|
|
7
|
+
path: readonly string[],
|
|
5
8
|
value: unknown,
|
|
6
9
|
): void {
|
|
7
|
-
if (typeof path === 'string') {
|
|
8
|
-
path = path.split(/[\.\[\]]/).filter(Boolean);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
10
|
if (path.length > 1) {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const newPath = [...path];
|
|
12
|
+
const key = newPath.shift()!;
|
|
13
|
+
const nextKey = newPath[0]!;
|
|
14
|
+
|
|
15
|
+
if (!obj[key]) {
|
|
16
|
+
obj[key] = isNumberString(nextKey) ? [] : {};
|
|
17
|
+
} else if (Array.isArray(obj[key]) && !isNumberString(nextKey)) {
|
|
18
|
+
obj[key] = Object.fromEntries(Object.entries(obj[key]));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
set(obj[key], newPath, value);
|
|
22
|
+
|
|
16
23
|
return;
|
|
17
24
|
}
|
|
18
25
|
const p = path[0]!;
|
|
@@ -29,7 +36,8 @@ export function formDataToObject(formData: FormData) {
|
|
|
29
36
|
const obj: Record<string, unknown> = {};
|
|
30
37
|
|
|
31
38
|
for (const [key, value] of formData.entries()) {
|
|
32
|
-
|
|
39
|
+
const parts = key.split(/[\.\[\]]/).filter(Boolean);
|
|
40
|
+
set(obj, parts, value);
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
return obj;
|
|
@@ -16,10 +16,11 @@ export * from './unstable-core-do-not-import/error/formatter';
|
|
|
16
16
|
export * from './unstable-core-do-not-import/error/getErrorShape';
|
|
17
17
|
export * from './unstable-core-do-not-import/error/TRPCError';
|
|
18
18
|
export * from './unstable-core-do-not-import/http/batchStreamFormatter';
|
|
19
|
-
export * from './unstable-core-do-not-import/http/parseConnectionParams';
|
|
20
19
|
export * from './unstable-core-do-not-import/http/contentType';
|
|
21
20
|
export * from './unstable-core-do-not-import/http/contentTypeParsers';
|
|
21
|
+
export * from './unstable-core-do-not-import/http/formDataToObject';
|
|
22
22
|
export * from './unstable-core-do-not-import/http/getHTTPStatusCode';
|
|
23
|
+
export * from './unstable-core-do-not-import/http/parseConnectionParams';
|
|
23
24
|
export * from './unstable-core-do-not-import/http/resolveResponse';
|
|
24
25
|
export * from './unstable-core-do-not-import/http/toURL';
|
|
25
26
|
export * from './unstable-core-do-not-import/http/types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formDataToObject.d.ts","sourceRoot":"","sources":["../../../src/adapters/next-app-dir/formDataToObject.ts"],"names":[],"mappings":"AA2BA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,2BAQlD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */ function set(obj, path, value) {
|
|
4
|
-
if (typeof path === 'string') {
|
|
5
|
-
path = path.split(/[\.\[\]]/).filter(Boolean);
|
|
6
|
-
}
|
|
7
|
-
if (path.length > 1) {
|
|
8
|
-
const p = path.shift();
|
|
9
|
-
const isArrayIndex = /^\d+$/.test(path[0]);
|
|
10
|
-
obj[p] = obj[p] || (isArrayIndex ? [] : {});
|
|
11
|
-
set(obj[p], path, value);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const p1 = path[0];
|
|
15
|
-
if (obj[p1] === undefined) {
|
|
16
|
-
obj[p1] = value;
|
|
17
|
-
} else if (Array.isArray(obj[p1])) {
|
|
18
|
-
obj[p1].push(value);
|
|
19
|
-
} else {
|
|
20
|
-
obj[p1] = [
|
|
21
|
-
obj[p1],
|
|
22
|
-
value
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function formDataToObject(formData) {
|
|
27
|
-
const obj = {};
|
|
28
|
-
for (const [key, value] of formData.entries()){
|
|
29
|
-
set(obj, key, value);
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.formDataToObject = formDataToObject;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-non-null-assertion */ function set(obj, path, value) {
|
|
2
|
-
if (typeof path === 'string') {
|
|
3
|
-
path = path.split(/[\.\[\]]/).filter(Boolean);
|
|
4
|
-
}
|
|
5
|
-
if (path.length > 1) {
|
|
6
|
-
const p = path.shift();
|
|
7
|
-
const isArrayIndex = /^\d+$/.test(path[0]);
|
|
8
|
-
obj[p] = obj[p] || (isArrayIndex ? [] : {});
|
|
9
|
-
set(obj[p], path, value);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const p1 = path[0];
|
|
13
|
-
if (obj[p1] === undefined) {
|
|
14
|
-
obj[p1] = value;
|
|
15
|
-
} else if (Array.isArray(obj[p1])) {
|
|
16
|
-
obj[p1].push(value);
|
|
17
|
-
} else {
|
|
18
|
-
obj[p1] = [
|
|
19
|
-
obj[p1],
|
|
20
|
-
value
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function formDataToObject(formData) {
|
|
25
|
-
const obj = {};
|
|
26
|
-
for (const [key, value] of formData.entries()){
|
|
27
|
-
set(obj, key, value);
|
|
28
|
-
}
|
|
29
|
-
return obj;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { formDataToObject };
|
/package/dist/{adapters/next-app-dir → unstable-core-do-not-import/http}/formDataToObject.d.ts
RENAMED
|
File without changes
|