typebox icon indicating copy to clipboard operation
typebox copied to clipboard

String format check does not work correctly

Open somnicattus opened this issue 1 year ago • 0 comments

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.

somnicattus avatar Oct 20 '24 04:10 somnicattus