@orpc/server 0.0.0-next.4220427 → 0.0.0-next.430a0fe
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/chunk-KPT6FDBK.js +32 -0
- package/dist/chunk-LXOL226G.js +182 -0
- package/dist/chunk-MHVECKBC.js +421 -0
- package/dist/chunk-XI6WGCB3.js +125 -0
- package/dist/fetch.js +6 -11
- package/dist/hono.js +19 -15
- package/dist/index.js +273 -405
- package/dist/next.js +7 -12
- package/dist/node.js +19 -75
- package/dist/plugins.js +11 -0
- package/dist/src/adapters/fetch/index.d.ts +1 -4
- package/dist/src/adapters/fetch/rpc-handler.d.ts +11 -0
- package/dist/src/adapters/fetch/types.d.ts +4 -11
- package/dist/src/adapters/hono/middleware.d.ts +6 -6
- package/dist/src/adapters/next/serve.d.ts +11 -11
- package/dist/src/adapters/node/index.d.ts +1 -3
- package/dist/src/adapters/node/rpc-handler.d.ts +11 -0
- package/dist/src/adapters/node/types.d.ts +15 -15
- package/dist/src/adapters/standard/handler.d.ts +51 -0
- package/dist/src/adapters/standard/index.d.ts +6 -0
- package/dist/src/adapters/standard/rpc-codec.d.ts +16 -0
- package/dist/src/adapters/standard/rpc-handler.d.ts +8 -0
- package/dist/src/adapters/standard/rpc-matcher.d.ts +10 -0
- package/dist/src/adapters/standard/types.d.ts +21 -0
- package/dist/src/builder-variants.d.ts +75 -0
- package/dist/src/builder.d.ts +53 -31
- package/dist/src/config.d.ts +6 -0
- package/dist/src/context.d.ts +8 -0
- package/dist/src/error.d.ts +9 -7
- package/dist/src/hidden.d.ts +6 -4
- package/dist/src/implementer-procedure.d.ts +33 -0
- package/dist/src/implementer-variants.d.ts +18 -0
- package/dist/src/implementer.d.ts +29 -0
- package/dist/src/index.d.ts +13 -12
- package/dist/src/lazy-utils.d.ts +4 -2
- package/dist/src/lazy.d.ts +9 -5
- package/dist/src/middleware-decorated.d.ts +7 -5
- package/dist/src/middleware-utils.d.ts +5 -0
- package/dist/src/middleware.d.ts +23 -20
- package/dist/src/plugins/base.d.ts +13 -0
- package/dist/src/plugins/cors.d.ts +19 -0
- package/dist/src/plugins/index.d.ts +4 -0
- package/dist/src/plugins/response-headers.d.ts +10 -0
- package/dist/src/procedure-client.d.ts +22 -23
- package/dist/src/procedure-decorated.d.ts +20 -11
- package/dist/src/procedure-utils.d.ts +19 -0
- package/dist/src/procedure.d.ts +20 -32
- package/dist/src/router-accessible-lazy.d.ts +8 -0
- package/dist/src/router-client.d.ts +8 -21
- package/dist/src/router.d.ts +26 -12
- package/dist/src/utils.d.ts +23 -2
- package/dist/standard.js +13 -0
- package/package.json +20 -3
- package/dist/chunk-DNG2IB3R.js +0 -227
- package/dist/chunk-V3I7RIRY.js +0 -302
- package/dist/chunk-WUOGVGWG.js +0 -1
- package/dist/src/adapters/fetch/orpc-handler.d.ts +0 -20
- package/dist/src/adapters/fetch/orpc-payload-codec.d.ts +0 -16
- package/dist/src/adapters/fetch/orpc-procedure-matcher.d.ts +0 -12
- package/dist/src/adapters/fetch/super-json.d.ts +0 -12
- package/dist/src/adapters/node/orpc-handler.d.ts +0 -12
- package/dist/src/adapters/node/request-listener.d.ts +0 -28
- package/dist/src/implementer-chainable.d.ts +0 -10
- package/dist/src/lazy-decorated.d.ts +0 -10
- package/dist/src/procedure-builder.d.ts +0 -24
- package/dist/src/procedure-implementer.d.ts +0 -19
- package/dist/src/router-builder.d.ts +0 -29
- package/dist/src/router-implementer.d.ts +0 -21
- package/dist/src/types.d.ts +0 -14
@@ -1,25 +1,12 @@
|
|
1
|
-
import type {
|
2
|
-
import type {
|
1
|
+
import type { ClientContext } from '@orpc/client';
|
2
|
+
import type { ErrorMap, Meta } from '@orpc/contract';
|
3
|
+
import type { MaybeOptionalOptions } from '@orpc/shared';
|
3
4
|
import type { Lazy } from './lazy';
|
4
5
|
import type { Procedure } from './procedure';
|
5
|
-
import type { ProcedureClient } from './procedure-client';
|
6
|
-
import type {
|
7
|
-
|
8
|
-
|
9
|
-
[K in keyof TRouter]: TRouter[K] extends ANY_ROUTER | ContractRouter ? RouterClient<TRouter[K], TClientContext> : never;
|
6
|
+
import type { CreateProcedureClientOptions, ProcedureClient } from './procedure-client';
|
7
|
+
import type { AnyRouter, InferRouterInitialContext } from './router';
|
8
|
+
export type RouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext = Record<never, never>> = TRouter extends Lazy<infer U extends AnyRouter> ? RouterClient<U, TClientContext> : TRouter extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput, infer UErrorMap, any> ? ProcedureClient<TClientContext, UInputSchema, UOutputSchema, UFuncOutput, UErrorMap> : {
|
9
|
+
[K in keyof TRouter]: TRouter[K] extends AnyRouter ? RouterClient<TRouter[K], TClientContext> : never;
|
10
10
|
};
|
11
|
-
export
|
12
|
-
router: TRouter | Lazy<undefined>;
|
13
|
-
/**
|
14
|
-
* This is helpful for logging and analytics.
|
15
|
-
*
|
16
|
-
* @internal
|
17
|
-
*/
|
18
|
-
path?: string[];
|
19
|
-
} & (TRouter extends Router<infer UContext, any> ? undefined extends UContext ? {
|
20
|
-
context?: Value<UContext>;
|
21
|
-
} : {
|
22
|
-
context: Value<UContext>;
|
23
|
-
} : never) & Hooks<unknown, unknown, TRouter extends Router<infer UContext, any> ? UContext : never, Meta>;
|
24
|
-
export declare function createRouterClient<TRouter extends ANY_ROUTER>(options: CreateRouterClientOptions<TRouter>): RouterClient<TRouter, unknown>;
|
11
|
+
export declare function createRouterClient<TRouter extends AnyRouter, TClientContext extends ClientContext>(router: TRouter | Lazy<undefined>, ...rest: MaybeOptionalOptions<CreateProcedureClientOptions<InferRouterInitialContext<TRouter>, undefined, undefined, unknown, ErrorMap, Meta, TClientContext>>): RouterClient<TRouter, TClientContext>;
|
25
12
|
//# sourceMappingURL=router-client.d.ts.map
|
package/dist/src/router.d.ts
CHANGED
@@ -1,16 +1,30 @@
|
|
1
|
-
import type { ContractProcedure,
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
|
6
|
-
|
1
|
+
import type { AnyContractRouter, ContractProcedure, ErrorMap, HTTPPath, MergedErrorMap, SchemaInput, SchemaOutput } from '@orpc/contract';
|
2
|
+
import type { Context } from './context';
|
3
|
+
import type { Lazy, Lazyable } from './lazy';
|
4
|
+
import type { AnyMiddleware } from './middleware';
|
5
|
+
import type { AnyProcedure } from './procedure';
|
6
|
+
import { Procedure } from './procedure';
|
7
|
+
import { type AccessibleLazyRouter } from './router-accessible-lazy';
|
8
|
+
export type Router<TInitialContext extends Context, TContract extends AnyContractRouter> = Lazyable<TContract extends ContractProcedure<infer UInputSchema, infer UOutputSchema, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, any, UInputSchema, UOutputSchema, any, UErrorMap, UMeta> : {
|
9
|
+
[K in keyof TContract]: TContract[K] extends AnyContractRouter ? Router<TInitialContext, TContract[K]> : never;
|
7
10
|
}>;
|
8
|
-
export type
|
9
|
-
export type
|
10
|
-
|
11
|
+
export type AnyRouter = Router<any, any>;
|
12
|
+
export type InferRouterInitialContext<T extends AnyRouter> = T extends Router<infer UInitialContext, any> ? UInitialContext : never;
|
13
|
+
export type InferRouterInputs<T extends AnyRouter> = T extends Lazy<infer U extends AnyRouter> ? InferRouterInputs<U> : T extends Procedure<any, any, infer UInputSchema, any, any, any, any> ? SchemaInput<UInputSchema> : {
|
14
|
+
[K in keyof T]: T[K] extends AnyRouter ? InferRouterInputs<T[K]> : never;
|
11
15
|
};
|
12
|
-
export type InferRouterOutputs<T extends
|
13
|
-
[K in keyof T]: T[K] extends
|
16
|
+
export type InferRouterOutputs<T extends AnyRouter> = T extends Lazy<infer U extends AnyRouter> ? InferRouterOutputs<U> : T extends Procedure<any, any, any, infer UOutputSchema, infer UFuncOutput, any, any> ? SchemaOutput<UOutputSchema, UFuncOutput> : {
|
17
|
+
[K in keyof T]: T[K] extends AnyRouter ? InferRouterOutputs<T[K]> : never;
|
14
18
|
};
|
15
|
-
export
|
19
|
+
export type AdaptedRouter<TRouter extends AnyRouter, TInitialContext extends Context, TErrorMap extends ErrorMap> = TRouter extends Lazy<infer U extends AnyRouter> ? AccessibleLazyRouter<AdaptedRouter<U, TInitialContext, TErrorMap>> : TRouter extends Procedure<any, infer UCurrentContext, infer UInputSchema, infer UOutputSchema, infer UFuncOutput, infer UErrorMap, infer UMeta> ? Procedure<TInitialContext, UCurrentContext, UInputSchema, UOutputSchema, UFuncOutput, MergedErrorMap<TErrorMap, UErrorMap>, UMeta> : {
|
20
|
+
[K in keyof TRouter]: TRouter[K] extends AnyRouter ? AdaptedRouter<TRouter[K], TInitialContext, TErrorMap> : never;
|
21
|
+
};
|
22
|
+
export interface AdaptRouterOptions<TErrorMap extends ErrorMap> {
|
23
|
+
middlewares: AnyMiddleware[];
|
24
|
+
tags?: readonly string[];
|
25
|
+
prefix?: HTTPPath;
|
26
|
+
errorMap: TErrorMap;
|
27
|
+
}
|
28
|
+
export declare function adaptRouter<TRouter extends AnyRouter, TInitialContext extends Context, TErrorMap extends ErrorMap>(router: TRouter, options: AdaptRouterOptions<TErrorMap>): AdaptedRouter<TRouter, TInitialContext, TErrorMap>;
|
29
|
+
export declare function getRouterChild<T extends AnyRouter | Lazy<undefined>>(router: T, ...path: string[]): T extends Lazy<any> ? Lazy<AnyProcedure> | Lazy<Record<string, AnyRouter>> | Lazy<undefined> : AnyRouter | Lazy<undefined> | undefined;
|
16
30
|
//# sourceMappingURL=router.d.ts.map
|
package/dist/src/utils.d.ts
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
-
import type {
|
2
|
-
|
1
|
+
import type { AnyContractProcedure, AnyContractRouter, HTTPPath } from '@orpc/contract';
|
2
|
+
import type { Lazy } from './lazy';
|
3
|
+
import type { AnyProcedure } from './procedure';
|
4
|
+
import type { AnyRouter } from './router';
|
5
|
+
export interface EachContractProcedureOptions {
|
6
|
+
router: AnyRouter | AnyContractRouter;
|
7
|
+
path: string[];
|
8
|
+
}
|
9
|
+
export interface EachContractProcedureCallbackOptions {
|
10
|
+
contract: AnyContractProcedure;
|
11
|
+
path: string[];
|
12
|
+
}
|
13
|
+
export interface EachContractProcedureLaziedOptions {
|
14
|
+
lazied: Lazy<AnyProcedure> | Lazy<Record<string, AnyRouter> | AnyProcedure>;
|
15
|
+
path: string[];
|
16
|
+
}
|
17
|
+
export declare function eachContractProcedure(options: EachContractProcedureOptions, callback: (options: EachContractProcedureCallbackOptions) => void, laziedOptions?: EachContractProcedureLaziedOptions[]): EachContractProcedureLaziedOptions[];
|
18
|
+
export declare function eachAllContractProcedure(options: EachContractProcedureOptions, callback: (options: EachContractProcedureCallbackOptions) => void): Promise<void>;
|
19
|
+
export declare function convertPathToHttpPath(path: string[]): HTTPPath;
|
20
|
+
/**
|
21
|
+
* Create a new procedure that ensure the contract is applied to the procedure.
|
22
|
+
*/
|
23
|
+
export declare function createContractedProcedure(contract: AnyContractProcedure, procedure: AnyProcedure): AnyProcedure;
|
3
24
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/standard.js
ADDED
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/server",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next.
|
4
|
+
"version": "0.0.0-next.430a0fe",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -19,6 +19,16 @@
|
|
19
19
|
"import": "./dist/index.js",
|
20
20
|
"default": "./dist/index.js"
|
21
21
|
},
|
22
|
+
"./plugins": {
|
23
|
+
"types": "./dist/src/plugins/index.d.ts",
|
24
|
+
"import": "./dist/plugins.js",
|
25
|
+
"default": "./dist/plugins.js"
|
26
|
+
},
|
27
|
+
"./standard": {
|
28
|
+
"types": "./dist/src/adapters/standard/index.d.ts",
|
29
|
+
"import": "./dist/standard.js",
|
30
|
+
"default": "./dist/standard.js"
|
31
|
+
},
|
22
32
|
"./fetch": {
|
23
33
|
"types": "./dist/src/adapters/fetch/index.d.ts",
|
24
34
|
"import": "./dist/fetch.js",
|
@@ -53,8 +63,15 @@
|
|
53
63
|
"next": ">=14.0.0"
|
54
64
|
},
|
55
65
|
"dependencies": {
|
56
|
-
"@orpc/
|
57
|
-
"@orpc/
|
66
|
+
"@orpc/server-standard": "^0.4.0",
|
67
|
+
"@orpc/server-standard-fetch": "^0.4.0",
|
68
|
+
"@orpc/server-standard-node": "^0.4.0",
|
69
|
+
"@orpc/client": "0.0.0-next.430a0fe",
|
70
|
+
"@orpc/shared": "0.0.0-next.430a0fe",
|
71
|
+
"@orpc/contract": "0.0.0-next.430a0fe"
|
72
|
+
},
|
73
|
+
"devDependencies": {
|
74
|
+
"light-my-request": "^6.5.1"
|
58
75
|
},
|
59
76
|
"scripts": {
|
60
77
|
"build": "tsup --onSuccess='tsc -b --noCheck'",
|
package/dist/chunk-DNG2IB3R.js
DELETED
@@ -1,227 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __export = (target, all) => {
|
3
|
-
for (var name in all)
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
5
|
-
};
|
6
|
-
|
7
|
-
// src/utils.ts
|
8
|
-
function mergeContext(a, b) {
|
9
|
-
if (!a)
|
10
|
-
return b;
|
11
|
-
if (!b)
|
12
|
-
return a;
|
13
|
-
return {
|
14
|
-
...a,
|
15
|
-
...b
|
16
|
-
};
|
17
|
-
}
|
18
|
-
|
19
|
-
// src/procedure.ts
|
20
|
-
import { isContractProcedure } from "@orpc/contract";
|
21
|
-
var Procedure = class {
|
22
|
-
"~type" = "Procedure";
|
23
|
-
"~orpc";
|
24
|
-
constructor(def) {
|
25
|
-
this["~orpc"] = def;
|
26
|
-
}
|
27
|
-
};
|
28
|
-
function isProcedure(item) {
|
29
|
-
if (item instanceof Procedure) {
|
30
|
-
return true;
|
31
|
-
}
|
32
|
-
return (typeof item === "object" || typeof item === "function") && item !== null && "~type" in item && item["~type"] === "Procedure" && "~orpc" in item && typeof item["~orpc"] === "object" && item["~orpc"] !== null && "contract" in item["~orpc"] && isContractProcedure(item["~orpc"].contract) && "handler" in item["~orpc"] && typeof item["~orpc"].handler === "function";
|
33
|
-
}
|
34
|
-
|
35
|
-
// src/error.ts
|
36
|
-
import { ORPCError } from "@orpc/contract";
|
37
|
-
function createORPCErrorConstructorMap(errors) {
|
38
|
-
const constructors = {};
|
39
|
-
if (!errors) {
|
40
|
-
return constructors;
|
41
|
-
}
|
42
|
-
for (const code in errors) {
|
43
|
-
const config = errors[code];
|
44
|
-
if (!config) {
|
45
|
-
continue;
|
46
|
-
}
|
47
|
-
const constructor = (...[options]) => {
|
48
|
-
return new ORPCError({
|
49
|
-
code,
|
50
|
-
defined: true,
|
51
|
-
status: config.status,
|
52
|
-
message: options?.message ?? config.message,
|
53
|
-
data: options?.data,
|
54
|
-
cause: options?.cause
|
55
|
-
});
|
56
|
-
};
|
57
|
-
constructors[code] = constructor;
|
58
|
-
}
|
59
|
-
return constructors;
|
60
|
-
}
|
61
|
-
|
62
|
-
// src/lazy.ts
|
63
|
-
var LAZY_LOADER_SYMBOL = Symbol("ORPC_LAZY_LOADER");
|
64
|
-
function lazy(loader) {
|
65
|
-
return {
|
66
|
-
[LAZY_LOADER_SYMBOL]: loader
|
67
|
-
};
|
68
|
-
}
|
69
|
-
function isLazy(item) {
|
70
|
-
return (typeof item === "object" || typeof item === "function") && item !== null && LAZY_LOADER_SYMBOL in item && typeof item[LAZY_LOADER_SYMBOL] === "function";
|
71
|
-
}
|
72
|
-
function unlazy(lazied) {
|
73
|
-
return isLazy(lazied) ? lazied[LAZY_LOADER_SYMBOL]() : Promise.resolve({ default: lazied });
|
74
|
-
}
|
75
|
-
function flatLazy(lazied) {
|
76
|
-
const flattenLoader = async () => {
|
77
|
-
let current = await unlazy(lazied);
|
78
|
-
while (true) {
|
79
|
-
if (!isLazy(current.default)) {
|
80
|
-
break;
|
81
|
-
}
|
82
|
-
current = await unlazy(current.default);
|
83
|
-
}
|
84
|
-
return current;
|
85
|
-
};
|
86
|
-
return lazy(flattenLoader);
|
87
|
-
}
|
88
|
-
|
89
|
-
// src/procedure-client.ts
|
90
|
-
import { ORPCError as ORPCError2, validateORPCError, ValidationError } from "@orpc/contract";
|
91
|
-
import { executeWithHooks, toError, value } from "@orpc/shared";
|
92
|
-
function createProcedureClient(options) {
|
93
|
-
return async (...[input, callerOptions]) => {
|
94
|
-
const path = options.path ?? [];
|
95
|
-
const { default: procedure } = await unlazy(options.procedure);
|
96
|
-
const context = await value(options.context);
|
97
|
-
const meta = {
|
98
|
-
path,
|
99
|
-
procedure,
|
100
|
-
signal: callerOptions?.signal
|
101
|
-
};
|
102
|
-
const executeWithValidation = async () => {
|
103
|
-
const validInput = await validateInput(procedure, input);
|
104
|
-
const output = await executeMiddlewareChain({
|
105
|
-
context,
|
106
|
-
input: validInput,
|
107
|
-
path,
|
108
|
-
procedure,
|
109
|
-
signal: callerOptions?.signal,
|
110
|
-
errors: createORPCErrorConstructorMap(procedure["~orpc"].contract["~orpc"].errorMap)
|
111
|
-
});
|
112
|
-
return validateOutput(procedure, output);
|
113
|
-
};
|
114
|
-
try {
|
115
|
-
const output = await executeWithHooks({
|
116
|
-
hooks: options,
|
117
|
-
input,
|
118
|
-
context,
|
119
|
-
meta,
|
120
|
-
execute: executeWithValidation
|
121
|
-
});
|
122
|
-
return output;
|
123
|
-
} catch (e) {
|
124
|
-
if (!(e instanceof ORPCError2)) {
|
125
|
-
throw toError(e);
|
126
|
-
}
|
127
|
-
const validated = await validateORPCError(procedure["~orpc"].contract["~orpc"].errorMap, e);
|
128
|
-
throw validated;
|
129
|
-
}
|
130
|
-
};
|
131
|
-
}
|
132
|
-
async function validateInput(procedure, input) {
|
133
|
-
const schema = procedure["~orpc"].contract["~orpc"].InputSchema;
|
134
|
-
if (!schema)
|
135
|
-
return input;
|
136
|
-
const result = await schema["~standard"].validate(input);
|
137
|
-
if (result.issues) {
|
138
|
-
throw new ORPCError2({
|
139
|
-
message: "Input validation failed",
|
140
|
-
code: "BAD_REQUEST",
|
141
|
-
data: {
|
142
|
-
issues: result.issues
|
143
|
-
},
|
144
|
-
cause: new ValidationError({ message: "Input validation failed", issues: result.issues })
|
145
|
-
});
|
146
|
-
}
|
147
|
-
return result.value;
|
148
|
-
}
|
149
|
-
async function validateOutput(procedure, output) {
|
150
|
-
const schema = procedure["~orpc"].contract["~orpc"].OutputSchema;
|
151
|
-
if (!schema)
|
152
|
-
return output;
|
153
|
-
const result = await schema["~standard"].validate(output);
|
154
|
-
if (result.issues) {
|
155
|
-
throw new ORPCError2({
|
156
|
-
message: "Output validation failed",
|
157
|
-
code: "INTERNAL_SERVER_ERROR",
|
158
|
-
cause: new ValidationError({ message: "Output validation failed", issues: result.issues })
|
159
|
-
});
|
160
|
-
}
|
161
|
-
return result.value;
|
162
|
-
}
|
163
|
-
async function executeMiddlewareChain(opt) {
|
164
|
-
const middlewares = opt.procedure["~orpc"].middlewares ?? [];
|
165
|
-
let currentMidIndex = 0;
|
166
|
-
let currentContext = opt.context;
|
167
|
-
const next = async (nextOptions) => {
|
168
|
-
const mid = middlewares[currentMidIndex];
|
169
|
-
currentMidIndex += 1;
|
170
|
-
currentContext = mergeContext(currentContext, nextOptions.context);
|
171
|
-
if (mid) {
|
172
|
-
return await mid({ ...opt, context: currentContext, next }, opt.input, (output) => ({ output, context: void 0 }));
|
173
|
-
}
|
174
|
-
const result = {
|
175
|
-
output: await opt.procedure["~orpc"].handler({ ...opt, context: currentContext }),
|
176
|
-
context: currentContext
|
177
|
-
};
|
178
|
-
return result;
|
179
|
-
};
|
180
|
-
return (await next({})).output;
|
181
|
-
}
|
182
|
-
|
183
|
-
// src/router.ts
|
184
|
-
function getRouterChild(router, ...path) {
|
185
|
-
let current = router;
|
186
|
-
for (let i = 0; i < path.length; i++) {
|
187
|
-
const segment = path[i];
|
188
|
-
if (!current) {
|
189
|
-
return void 0;
|
190
|
-
}
|
191
|
-
if (isProcedure(current)) {
|
192
|
-
return void 0;
|
193
|
-
}
|
194
|
-
if (!isLazy(current)) {
|
195
|
-
current = current[segment];
|
196
|
-
continue;
|
197
|
-
}
|
198
|
-
const lazied = current;
|
199
|
-
const rest = path.slice(i);
|
200
|
-
const newLazy = lazy(async () => {
|
201
|
-
const unwrapped = await unlazy(lazied);
|
202
|
-
if (!unwrapped.default) {
|
203
|
-
return unwrapped;
|
204
|
-
}
|
205
|
-
const next = getRouterChild(unwrapped.default, ...rest);
|
206
|
-
return { default: next };
|
207
|
-
});
|
208
|
-
return flatLazy(newLazy);
|
209
|
-
}
|
210
|
-
return current;
|
211
|
-
}
|
212
|
-
|
213
|
-
export {
|
214
|
-
__export,
|
215
|
-
mergeContext,
|
216
|
-
Procedure,
|
217
|
-
isProcedure,
|
218
|
-
createORPCErrorConstructorMap,
|
219
|
-
LAZY_LOADER_SYMBOL,
|
220
|
-
lazy,
|
221
|
-
isLazy,
|
222
|
-
unlazy,
|
223
|
-
flatLazy,
|
224
|
-
createProcedureClient,
|
225
|
-
getRouterChild
|
226
|
-
};
|
227
|
-
//# sourceMappingURL=chunk-DNG2IB3R.js.map
|