@@ -38,22 +38,24 @@ type PreserveOptional<NewType, OrigType> =
3838export type TransformNodeType < Type > =
3939 Type extends ( ...args : infer Args ) => infer Ret
4040 ? ( ...args : TransformNodeType < Args > ) => TransformNodeType < Ret >
41- : Type extends Array < infer Item >
42- ? Array < TransformNodeType < Item > >
43- : Type extends Promise < infer T >
44- ? Promise < TransformNodeType < T > >
45- : Type extends { [ P in any ] : any }
46- ? {
47- [ Property in keyof Type ] :
48- Property extends BigIntPropertyNames
49- ? PreserveOptional < bigint , Type [ Property ] >
50- : Property extends NumberPropertyNames
51- ? PreserveOptional < number , Type [ Property ] >
52- : Property extends 'txHash'
53- ? PreserveOptional < EncodedData < 'th' > , Type [ Property ] >
54- : TransformNodeType < Type [ Property ] >
55- }
56- : Type
41+ : Type extends [ infer Item , ...infer Rest ]
42+ ? [ TransformNodeType < Item > , ...TransformNodeType < Rest > ]
43+ : Type extends Array < infer Item >
44+ ? Array < TransformNodeType < Item > >
45+ : Type extends Promise < infer T >
46+ ? Promise < TransformNodeType < T > >
47+ : Type extends { [ P in any ] : any }
48+ ? {
49+ [ Property in keyof Type ] :
50+ Property extends BigIntPropertyNames
51+ ? PreserveOptional < bigint , Type [ Property ] >
52+ : Property extends NumberPropertyNames
53+ ? PreserveOptional < number , Type [ Property ] >
54+ : Property extends 'txHash'
55+ ? PreserveOptional < EncodedData < 'th' > , Type [ Property ] >
56+ : TransformNodeType < Type [ Property ] >
57+ }
58+ : Type
5759type TransformedNode = new ( ...args : ConstructorParameters < typeof Node > ) => {
5860 [ Name in keyof InstanceType < typeof Node > ] : TransformNodeType < Node [ Name ] >
5961}
0 commit comments