Typescript 4.9 satisfies
does not properly enforce enum on SomeJTDSchemaType
#2205
Labels
satisfies
does not properly enforce enum on SomeJTDSchemaType
#2205
Ajv version
8.12.0
Typescript 4.9 allows us to use the
satisfies
operator, which can be used to enforce the correctness of a schema throughSomeJTDSchemaType
before sending it toJTDDataType
:This feature does not work properly with
enum
types:In fact, in
types/jtd-schema.ts:14
, we see thatSomeJTDSchemaType
contains{enum: string[]}
, to whichreadonly [...]
cannot be assigned to.This seems fixable by simply changing the enum type in this file to
{enum: readonly string[]}
.Can I open a PR for that?
The text was updated successfully, but these errors were encountered: