@@ -53,23 +53,23 @@ export type Options = Partial<{
5353 removeJsonc : boolean
5454} >
5555
56- type ModifyProperties < T extends object > = {
56+ type ModifyProperties < T extends Record < string , any > > = {
5757 [ K in keyof T ] ?: T [ K ] | ( ( oldValue : T [ K ] , json : T ) => T [ K ] )
58- //T[K] extends object ? ((oldValue: T[K]) => unknown)/* | GettersDeep<T[K]> */ : (oldValue: T[K]) => unknown
58+ //T[K] extends Record<string, any> ? ((oldValue: T[K]) => unknown)/* | GettersDeep<T[K]> */ : (oldValue: T[K]) => unknown
5959}
6060type ModifyFunction < T > = ( oldJson : T ) => MaybePromise < T >
6161
6262// TODO remove duplicated definitions
6363
6464export type ModifyJsonFileFunction < T extends JsonRoot , DefaultName extends boolean = false > = (
6565 path : DefaultName extends true ? string | { dir : string } : string ,
66- modifyProperties : T extends object ? ModifyProperties < T > | ModifyFunction < T > : ModifyFunction < T > ,
66+ modifyProperties : T extends Record < string , any > ? ModifyProperties < T > | ModifyFunction < T > : ModifyFunction < T > ,
6767 options ?: Partial < Options > ,
6868) => Promise < void >
6969
70- type ModifyJsonFileGenericFunction = < T extends JsonRoot = object > (
70+ type ModifyJsonFileGenericFunction = < T extends JsonRoot = Record < string , any > > (
7171 path : string ,
72- modifyProperties : T extends object ? ModifyProperties < T > | ModifyFunction < T > : ModifyFunction < T > ,
72+ modifyProperties : T extends Record < string , any > ? ModifyProperties < T > | ModifyFunction < T > : ModifyFunction < T > ,
7373 options ?: Partial < Options > ,
7474) => Promise < void >
7575
0 commit comments