typebox-validators
typebox-validators copied to clipboard
TS2345: Argument of type 'TObject<{ handle: TString; count: TInteger; }>' is not assignable to parameter of type 'TSchema'.<br/>Property '[Kind]' is missing in type 'TObject<{ handle: TString; count: TInteger; }>' but required in type 'TSchema'.
Getting this type error while following the example StandardValidator
const schema = Type.Object({
handle: Type.String({
minLength: 5,
maxLength: 10,
pattern: '^[a-zA-Z]+$',
errorMessage: 'must be a string of 5 to 10 letters',
}),
count: Type.Integer({ minimum: 0 }),
})
const validator = new StandardValidator(schema)
My understanding is kind is only necessary for Union types?
Sorry, I've been unable to keep up with the breaking changes in TypeBox and do not plan to provide further support for this repo.