Skip to content

Commit bfdd0d9

Browse files
committed
Preserve type parameter constraint in emitted mapped types while preserving their distributivity
1 parent f9cf821 commit bfdd0d9

7 files changed

+349
-7
lines changed

src/compiler/checker.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6638,22 +6638,31 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
66386638
const questionToken = type.declaration.questionToken ? factory.createToken(type.declaration.questionToken.kind) as QuestionToken | PlusToken | MinusToken : undefined;
66396639
let appropriateConstraintTypeNode: TypeNode;
66406640
let newTypeVariable: TypeReferenceNode | undefined;
6641+
let templateType = getTemplateTypeFromMappedType(type);
6642+
let typeParameter = getTypeParameterFromMappedType(type);
66416643
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
66426644
// We have a { [P in keyof T]: X }
66436645
// We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`
66446646
if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type) && context.flags & NodeBuilderFlags.GenerateNamesForShadowedTypeParams) {
6645-
const newParam = createTypeParameter(createSymbol(SymbolFlags.TypeParameter, "T" as __String));
6646-
const name = typeParameterToName(newParam, context);
6647+
const newConstraintParam = createTypeParameter(createSymbol(SymbolFlags.TypeParameter, "T" as __String));
6648+
const newTypeParam = createTypeParameter(createSymbol(SymbolFlags.TypeParameter, "K" as __String));
6649+
const name = typeParameterToName(newConstraintParam, context);
6650+
const target = type.target as MappedType;
6651+
typeParameter = newTypeParam;
66476652
newTypeVariable = factory.createTypeReferenceNode(name);
6653+
templateType = instantiateType(
6654+
getTemplateTypeFromMappedType(target),
6655+
makeArrayTypeMapper([getTypeParameterFromMappedType(target), getModifiersTypeFromMappedType(target)], [newTypeParam, newConstraintParam])
6656+
);
66486657
}
66496658
appropriateConstraintTypeNode = factory.createTypeOperatorNode(SyntaxKind.KeyOfKeyword, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
66506659
}
66516660
else {
66526661
appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);
66536662
}
6654-
const typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode);
6663+
const typeParameterNode = typeParameterToDeclarationWithConstraint(typeParameter, context, appropriateConstraintTypeNode);
66556664
const nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type)!, context) : undefined;
6656-
const templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type), !!(getMappedTypeModifiers(type) & MappedTypeModifiers.IncludeOptional)), context);
6665+
const templateTypeNode = typeToTypeNodeHelper(removeMissingType(templateType, !!(getMappedTypeModifiers(type) & MappedTypeModifiers.IncludeOptional)), context);
66576666
const mappedTypeNode = factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode, /*members*/ undefined);
66586667
context.approximateLength += 10;
66596668
const result = setEmitFlags(mappedTypeNode, EmitFlags.SingleLine);

tests/baselines/reference/declarationEmitMappedTypeDistributivityPreservesConstraints.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ declare const _default: {
5252
fn: <T_1 extends {
5353
x: T_1["x"] extends infer T extends {
5454
[x: string]: (...params: unknown[]) => unknown;
55-
} ? { [K in keyof T]: T_1["x"][K]; } : never;
55+
} ? { [K in keyof T]: T[K]; } : never;
5656
}>(sliceIndex: T_1) => T_1["x"] extends infer T_2 extends {
5757
[x: string]: (...params: unknown[]) => unknown;
58-
} ? { [K_1 in keyof T_2]: Parameters<T_1["x"][K_1]>; } : never;
58+
} ? { [K_1 in keyof T_2]: Parameters<T_2[K_1]>; } : never;
5959
};
6060
};
6161
export default _default;
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
//// [tests/cases/compiler/declarationEmitMappedTypePreservesTypeParameterConstraint.ts] ////
2+
3+
//// [declarationEmitMappedTypePreservesTypeParameterConstraint.ts]
4+
// repro from https://github.com/microsoft/TypeScript/issues/54560
5+
6+
declare type requiredKeys<T extends object> = {
7+
[k in keyof T]: undefined extends T[k] ? never : k;
8+
}[keyof T];
9+
10+
declare type addQuestionMarks<
11+
T extends object,
12+
R extends keyof T = requiredKeys<T>
13+
> = Pick<Required<T>, R> & Partial<T>;
14+
15+
declare type identity<T> = T;
16+
17+
declare type flatten<T> = identity<{
18+
[k in keyof T]: T[k];
19+
}>;
20+
21+
export declare abstract class ZodType<Output = any> {
22+
readonly _output: Output;
23+
}
24+
25+
export declare class ZodLiteral<T> extends ZodType<T> {}
26+
27+
export declare type ZodTypeAny = ZodType<any>;
28+
29+
export declare type baseObjectOutputType<Shape extends ZodRawShape> = {
30+
[k in keyof Shape]: Shape[k]["_output"];
31+
};
32+
33+
export declare type objectOutputType<Shape extends ZodRawShape> = flatten<
34+
addQuestionMarks<baseObjectOutputType<Shape>>
35+
>;
36+
37+
export declare type ZodRawShape = {
38+
[k: string]: ZodTypeAny;
39+
};
40+
41+
export const buildSchema = <V extends string>(
42+
version: V
43+
): objectOutputType<{
44+
version: ZodLiteral<V>;
45+
}> => ({} as any);
46+
47+
48+
//// [declarationEmitMappedTypePreservesTypeParameterConstraint.js]
49+
"use strict";
50+
// repro from https://github.com/microsoft/TypeScript/issues/54560
51+
Object.defineProperty(exports, "__esModule", { value: true });
52+
exports.buildSchema = void 0;
53+
var buildSchema = function (version) { return ({}); };
54+
exports.buildSchema = buildSchema;
55+
56+
57+
//// [declarationEmitMappedTypePreservesTypeParameterConstraint.d.ts]
58+
declare type requiredKeys<T extends object> = {
59+
[k in keyof T]: undefined extends T[k] ? never : k;
60+
}[keyof T];
61+
declare type addQuestionMarks<T extends object, R extends keyof T = requiredKeys<T>> = Pick<Required<T>, R> & Partial<T>;
62+
declare type identity<T> = T;
63+
declare type flatten<T> = identity<{
64+
[k in keyof T]: T[k];
65+
}>;
66+
export declare abstract class ZodType<Output = any> {
67+
readonly _output: Output;
68+
}
69+
export declare class ZodLiteral<T> extends ZodType<T> {
70+
}
71+
export declare type ZodTypeAny = ZodType<any>;
72+
export declare type baseObjectOutputType<Shape extends ZodRawShape> = {
73+
[k in keyof Shape]: Shape[k]["_output"];
74+
};
75+
export declare type objectOutputType<Shape extends ZodRawShape> = flatten<addQuestionMarks<baseObjectOutputType<Shape>>>;
76+
export declare type ZodRawShape = {
77+
[k: string]: ZodTypeAny;
78+
};
79+
export declare const buildSchema: <V extends string>(version: V) => addQuestionMarks<baseObjectOutputType<{
80+
version: ZodLiteral<V>;
81+
}>, undefined extends V ? never : "version"> extends infer T ? { [K in keyof T]: T[K]; } : never;
82+
export {};
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
//// [tests/cases/compiler/declarationEmitMappedTypePreservesTypeParameterConstraint.ts] ////
2+
3+
=== declarationEmitMappedTypePreservesTypeParameterConstraint.ts ===
4+
// repro from https://github.com/microsoft/TypeScript/issues/54560
5+
6+
declare type requiredKeys<T extends object> = {
7+
>requiredKeys : Symbol(requiredKeys, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 0, 0))
8+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 2, 26))
9+
10+
[k in keyof T]: undefined extends T[k] ? never : k;
11+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 3, 3))
12+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 2, 26))
13+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 2, 26))
14+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 3, 3))
15+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 3, 3))
16+
17+
}[keyof T];
18+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 2, 26))
19+
20+
declare type addQuestionMarks<
21+
>addQuestionMarks : Symbol(addQuestionMarks, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 4, 11))
22+
23+
T extends object,
24+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 6, 30))
25+
26+
R extends keyof T = requiredKeys<T>
27+
>R : Symbol(R, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 7, 19))
28+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 6, 30))
29+
>requiredKeys : Symbol(requiredKeys, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 0, 0))
30+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 6, 30))
31+
32+
> = Pick<Required<T>, R> & Partial<T>;
33+
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
34+
>Required : Symbol(Required, Decl(lib.es5.d.ts, --, --))
35+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 6, 30))
36+
>R : Symbol(R, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 7, 19))
37+
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
38+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 6, 30))
39+
40+
declare type identity<T> = T;
41+
>identity : Symbol(identity, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 9, 38))
42+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 11, 22))
43+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 11, 22))
44+
45+
declare type flatten<T> = identity<{
46+
>flatten : Symbol(flatten, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 11, 29))
47+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 13, 21))
48+
>identity : Symbol(identity, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 9, 38))
49+
50+
[k in keyof T]: T[k];
51+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 14, 3))
52+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 13, 21))
53+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 13, 21))
54+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 14, 3))
55+
56+
}>;
57+
58+
export declare abstract class ZodType<Output = any> {
59+
>ZodType : Symbol(ZodType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 15, 3))
60+
>Output : Symbol(Output, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 17, 38))
61+
62+
readonly _output: Output;
63+
>_output : Symbol(ZodType._output, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 17, 53))
64+
>Output : Symbol(Output, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 17, 38))
65+
}
66+
67+
export declare class ZodLiteral<T> extends ZodType<T> {}
68+
>ZodLiteral : Symbol(ZodLiteral, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 19, 1))
69+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 21, 32))
70+
>ZodType : Symbol(ZodType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 15, 3))
71+
>T : Symbol(T, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 21, 32))
72+
73+
export declare type ZodTypeAny = ZodType<any>;
74+
>ZodTypeAny : Symbol(ZodTypeAny, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 21, 56))
75+
>ZodType : Symbol(ZodType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 15, 3))
76+
77+
export declare type baseObjectOutputType<Shape extends ZodRawShape> = {
78+
>baseObjectOutputType : Symbol(baseObjectOutputType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 23, 46))
79+
>Shape : Symbol(Shape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 25, 41))
80+
>ZodRawShape : Symbol(ZodRawShape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 31, 2))
81+
82+
[k in keyof Shape]: Shape[k]["_output"];
83+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 26, 3))
84+
>Shape : Symbol(Shape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 25, 41))
85+
>Shape : Symbol(Shape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 25, 41))
86+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 26, 3))
87+
88+
};
89+
90+
export declare type objectOutputType<Shape extends ZodRawShape> = flatten<
91+
>objectOutputType : Symbol(objectOutputType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 27, 2))
92+
>Shape : Symbol(Shape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 29, 37))
93+
>ZodRawShape : Symbol(ZodRawShape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 31, 2))
94+
>flatten : Symbol(flatten, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 11, 29))
95+
96+
addQuestionMarks<baseObjectOutputType<Shape>>
97+
>addQuestionMarks : Symbol(addQuestionMarks, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 4, 11))
98+
>baseObjectOutputType : Symbol(baseObjectOutputType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 23, 46))
99+
>Shape : Symbol(Shape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 29, 37))
100+
101+
>;
102+
103+
export declare type ZodRawShape = {
104+
>ZodRawShape : Symbol(ZodRawShape, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 31, 2))
105+
106+
[k: string]: ZodTypeAny;
107+
>k : Symbol(k, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 34, 3))
108+
>ZodTypeAny : Symbol(ZodTypeAny, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 21, 56))
109+
110+
};
111+
112+
export const buildSchema = <V extends string>(
113+
>buildSchema : Symbol(buildSchema, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 37, 12))
114+
>V : Symbol(V, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 37, 28))
115+
116+
version: V
117+
>version : Symbol(version, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 37, 46))
118+
>V : Symbol(V, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 37, 28))
119+
120+
): objectOutputType<{
121+
>objectOutputType : Symbol(objectOutputType, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 27, 2))
122+
123+
version: ZodLiteral<V>;
124+
>version : Symbol(version, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 39, 21))
125+
>ZodLiteral : Symbol(ZodLiteral, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 19, 1))
126+
>V : Symbol(V, Decl(declarationEmitMappedTypePreservesTypeParameterConstraint.ts, 37, 28))
127+
128+
}> => ({} as any);
129+
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//// [tests/cases/compiler/declarationEmitMappedTypePreservesTypeParameterConstraint.ts] ////
2+
3+
=== declarationEmitMappedTypePreservesTypeParameterConstraint.ts ===
4+
// repro from https://github.com/microsoft/TypeScript/issues/54560
5+
6+
declare type requiredKeys<T extends object> = {
7+
>requiredKeys : requiredKeys<T>
8+
9+
[k in keyof T]: undefined extends T[k] ? never : k;
10+
}[keyof T];
11+
12+
declare type addQuestionMarks<
13+
>addQuestionMarks : addQuestionMarks<T, R>
14+
15+
T extends object,
16+
R extends keyof T = requiredKeys<T>
17+
> = Pick<Required<T>, R> & Partial<T>;
18+
19+
declare type identity<T> = T;
20+
>identity : T
21+
22+
declare type flatten<T> = identity<{
23+
>flatten : { [k in keyof T]: T[k]; }
24+
25+
[k in keyof T]: T[k];
26+
}>;
27+
28+
export declare abstract class ZodType<Output = any> {
29+
>ZodType : ZodType<Output>
30+
31+
readonly _output: Output;
32+
>_output : Output
33+
}
34+
35+
export declare class ZodLiteral<T> extends ZodType<T> {}
36+
>ZodLiteral : ZodLiteral<T>
37+
>ZodType : ZodType<T>
38+
39+
export declare type ZodTypeAny = ZodType<any>;
40+
>ZodTypeAny : ZodType<any>
41+
42+
export declare type baseObjectOutputType<Shape extends ZodRawShape> = {
43+
>baseObjectOutputType : baseObjectOutputType<Shape>
44+
45+
[k in keyof Shape]: Shape[k]["_output"];
46+
};
47+
48+
export declare type objectOutputType<Shape extends ZodRawShape> = flatten<
49+
>objectOutputType : { [k in keyof addQuestionMarks<baseObjectOutputType<Shape>, requiredKeys<baseObjectOutputType<Shape>>>]: addQuestionMarks<baseObjectOutputType<Shape>, requiredKeys<baseObjectOutputType<Shape>>>[k]; }
50+
51+
addQuestionMarks<baseObjectOutputType<Shape>>
52+
>;
53+
54+
export declare type ZodRawShape = {
55+
>ZodRawShape : { [k: string]: ZodTypeAny; }
56+
57+
[k: string]: ZodTypeAny;
58+
>k : string
59+
60+
};
61+
62+
export const buildSchema = <V extends string>(
63+
>buildSchema : <V extends string>(version: V) => { [k in keyof addQuestionMarks<baseObjectOutputType<{ version: ZodLiteral<V>; }>, undefined extends V ? never : "version">]: addQuestionMarks<baseObjectOutputType<{ version: ZodLiteral<V>; }>, undefined extends V ? never : "version">[k]; }
64+
><V extends string>( version: V): objectOutputType<{ version: ZodLiteral<V>;}> => ({} as any) : <V extends string>(version: V) => { [k in keyof addQuestionMarks<baseObjectOutputType<{ version: ZodLiteral<V>; }>, undefined extends V ? never : "version">]: addQuestionMarks<baseObjectOutputType<{ version: ZodLiteral<V>; }>, undefined extends V ? never : "version">[k]; }
65+
66+
version: V
67+
>version : V
68+
69+
): objectOutputType<{
70+
version: ZodLiteral<V>;
71+
>version : ZodLiteral<V>
72+
73+
}> => ({} as any);
74+
>({} as any) : any
75+
>{} as any : any
76+
>{} : {}
77+

tests/baselines/reference/mappedTypeGenericInstantiationPreservesHomomorphism.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ type PrivateMapped<Obj> = {
3535
};
3636
export {};
3737
//// [api.d.ts]
38-
export declare const mappedUnionWithPrivateType: <T extends unknown[]>(...args: T) => T[any] extends infer T_1 ? { [K in keyof T_1]: T[any][K]; } : never;
38+
export declare const mappedUnionWithPrivateType: <T extends unknown[]>(...args: T) => T[any] extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// @strict: true
2+
// @declaration: true
3+
4+
// repro from https://github.com/microsoft/TypeScript/issues/54560
5+
6+
declare type requiredKeys<T extends object> = {
7+
[k in keyof T]: undefined extends T[k] ? never : k;
8+
}[keyof T];
9+
10+
declare type addQuestionMarks<
11+
T extends object,
12+
R extends keyof T = requiredKeys<T>
13+
> = Pick<Required<T>, R> & Partial<T>;
14+
15+
declare type identity<T> = T;
16+
17+
declare type flatten<T> = identity<{
18+
[k in keyof T]: T[k];
19+
}>;
20+
21+
export declare abstract class ZodType<Output = any> {
22+
readonly _output: Output;
23+
}
24+
25+
export declare class ZodLiteral<T> extends ZodType<T> {}
26+
27+
export declare type ZodTypeAny = ZodType<any>;
28+
29+
export declare type baseObjectOutputType<Shape extends ZodRawShape> = {
30+
[k in keyof Shape]: Shape[k]["_output"];
31+
};
32+
33+
export declare type objectOutputType<Shape extends ZodRawShape> = flatten<
34+
addQuestionMarks<baseObjectOutputType<Shape>>
35+
>;
36+
37+
export declare type ZodRawShape = {
38+
[k: string]: ZodTypeAny;
39+
};
40+
41+
export const buildSchema = <V extends string>(
42+
version: V
43+
): objectOutputType<{
44+
version: ZodLiteral<V>;
45+
}> => ({} as any);

0 commit comments

Comments
 (0)