typebox
typebox copied to clipboard
String format check does not work correctly
minimal reproduction:
import { Type } from '@sinclair/typebox';
import { Value } from '@sinclair/typebox';
console.log(Value.Check(Type.String({ format: 'uuid' }), crypto.randomUUID()));
// false
The result was same with format: 'date-time' and new Date().toISOString(). All formats do not work?
I also checked older versions and the result was same.
I also checked pattern option and it worked.