@@ -39,7 +39,7 @@ const formatValidators: Record<
3939 ) => undefined | JsonError | JsonError [ ]
4040> = {
4141 date : ( draft , schema , value , pointer ) => {
42- if ( typeof value !== "string" ) {
42+ if ( typeof value !== "string" || value === "" ) {
4343 return undefined ;
4444 }
4545 // https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts
@@ -65,7 +65,7 @@ const formatValidators: Record<
6565 } ,
6666
6767 "date-time" : ( draft , schema , value , pointer ) => {
68- if ( typeof value !== "string" ) {
68+ if ( typeof value !== "string" || value === "" ) {
6969 return undefined ;
7070 }
7171 if ( value === "" || isValidDateTime . test ( value ) ) {
@@ -79,7 +79,7 @@ const formatValidators: Record<
7979
8080 email : ( draft , schema , value , pointer ) => {
8181 // taken from https://github.com/ExodusMovement/schemasafe/blob/master/src/formats.js
82- if ( typeof value !== "string" ) {
82+ if ( typeof value !== "string" || value === "" ) {
8383 return undefined ;
8484 }
8585 if ( value [ 0 ] === '"' ) {
@@ -176,7 +176,7 @@ const formatValidators: Record<
176176 } ,
177177
178178 time : ( draft , schema , value , pointer ) => {
179- if ( typeof value !== "string" ) {
179+ if ( typeof value !== "string" || value === "" ) {
180180 return undefined ;
181181 }
182182 // https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts
0 commit comments