grantila / suretype

Typesafe JSON (Schema) validator
502 stars 9 forks source link

Fix incompatibility with TS4.7 #28

Closed hborchardt closed 1 year ago

hborchardt commented 2 years ago

Hi, after upgrading to TypeScript 4.7 I got this error:

Error: node_modules/suretype/dist/validators/functional.d.ts:25:96 - error TS2344: Type 'T' does not satisfy the constraint '{}'.

25 export declare type AdditionalProperties<T, U> = FlattenObject<T & Record<string, U | ValuesOf<T>>>;
                                                                                                  ~

  node_modules/suretype/dist/validators/functional.d.ts:25:42
    25 export declare type AdditionalProperties<T, U> = FlattenObject<T & Record<string, U | ValuesOf<T>>>;
                                                ~
    This type parameter might need an `extends {}` constraint.

I am implementing the suggested resolution.

grantila commented 1 year ago

Thanks! Sorry for being slow to fix this, but it's released now in 3.1.0