hono 4.3.1 → 4.3.2
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/types/types.d.ts +22 -21
- package/package.json +1 -1
package/dist/types/types.d.ts
CHANGED
|
@@ -406,29 +406,30 @@ type FlattenIfIntersect<T> = T extends infer O ? {
|
|
|
406
406
|
} : never;
|
|
407
407
|
export type MergeSchemaPath<OrigSchema extends Schema, SubPath extends string> = Prettify<{
|
|
408
408
|
[P in keyof OrigSchema as MergePath<SubPath, P & string>]: {
|
|
409
|
-
[M in keyof OrigSchema[P]]: OrigSchema[P][M]
|
|
410
|
-
input: infer Input;
|
|
411
|
-
output: infer Output;
|
|
412
|
-
outputFormat: infer OutputFormat;
|
|
413
|
-
status: infer Status;
|
|
414
|
-
} ? {
|
|
415
|
-
input: Input extends {
|
|
416
|
-
param: infer _;
|
|
417
|
-
} ? ExtractParams<SubPath> extends never ? Input : FlattenIfIntersect<Input & {
|
|
418
|
-
param: {
|
|
419
|
-
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
420
|
-
};
|
|
421
|
-
}> : RemoveBlankRecord<ExtractParams<SubPath>> extends never ? Input : Input & {
|
|
422
|
-
param: {
|
|
423
|
-
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
output: Output;
|
|
427
|
-
outputFormat: OutputFormat;
|
|
428
|
-
status: Status;
|
|
429
|
-
} : never;
|
|
409
|
+
[M in keyof OrigSchema[P]]: MergeEndpointParamsWithPath<OrigSchema[P][M], SubPath>;
|
|
430
410
|
};
|
|
431
411
|
}>;
|
|
412
|
+
type MergeEndpointParamsWithPath<T, SubPath extends string> = T extends {
|
|
413
|
+
input: infer Input;
|
|
414
|
+
output: infer Output;
|
|
415
|
+
outputFormat: infer OutputFormat;
|
|
416
|
+
status: infer Status;
|
|
417
|
+
} ? {
|
|
418
|
+
input: Input extends {
|
|
419
|
+
param: infer _;
|
|
420
|
+
} ? ExtractParams<SubPath> extends never ? Input : FlattenIfIntersect<Input & {
|
|
421
|
+
param: {
|
|
422
|
+
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
423
|
+
};
|
|
424
|
+
}> : RemoveBlankRecord<ExtractParams<SubPath>> extends never ? Input : Input & {
|
|
425
|
+
param: {
|
|
426
|
+
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
output: Output;
|
|
430
|
+
outputFormat: OutputFormat;
|
|
431
|
+
status: Status;
|
|
432
|
+
} : never;
|
|
432
433
|
export type AddParam<I, P extends string> = ParamKeys<P> extends never ? I : I extends {
|
|
433
434
|
param: infer _;
|
|
434
435
|
} ? I : I & {
|