@@ -39,7 +39,7 @@ const formatValidators: Record<
39
39
) => undefined | JsonError | JsonError [ ]
40
40
> = {
41
41
date : ( draft , schema , value , pointer ) => {
42
- if ( typeof value !== "string" ) {
42
+ if ( typeof value !== "string" || value === "" ) {
43
43
return undefined ;
44
44
}
45
45
// https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts
@@ -65,7 +65,7 @@ const formatValidators: Record<
65
65
} ,
66
66
67
67
"date-time" : ( draft , schema , value , pointer ) => {
68
- if ( typeof value !== "string" ) {
68
+ if ( typeof value !== "string" || value === "" ) {
69
69
return undefined ;
70
70
}
71
71
if ( value === "" || isValidDateTime . test ( value ) ) {
@@ -79,7 +79,7 @@ const formatValidators: Record<
79
79
80
80
email : ( draft , schema , value , pointer ) => {
81
81
// taken from https://github.com/ExodusMovement/schemasafe/blob/master/src/formats.js
82
- if ( typeof value !== "string" ) {
82
+ if ( typeof value !== "string" || value === "" ) {
83
83
return undefined ;
84
84
}
85
85
if ( value [ 0 ] === '"' ) {
@@ -176,7 +176,7 @@ const formatValidators: Record<
176
176
} ,
177
177
178
178
time : ( draft , schema , value , pointer ) => {
179
- if ( typeof value !== "string" ) {
179
+ if ( typeof value !== "string" || value === "" ) {
180
180
return undefined ;
181
181
}
182
182
// https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts
0 commit comments