Commit 8e2c207 1 parent 430949c commit 8e2c207 Copy full SHA for 8e2c207
File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -236,20 +236,17 @@ class Validator {
236
236
) ;
237
237
238
238
const validate = ( value ) => {
239
- if ( slotDefinition . required && ! value ) {
240
- return 'This field is required' ;
241
- }
242
-
243
- if ( slotDefinition . value_presence === 'PRESENT' && ! value ) {
244
- return 'Value is not present' ;
245
- } else if ( slotDefinition . value_presence === 'ABSENT' && value ) {
246
- return 'Value is not absent' ;
247
- }
248
-
249
239
if ( ! value ) {
240
+ if ( slotDefinition . required )
241
+ return 'This field is required' ;
242
+ if ( slotDefinition . value_presence === 'PRESENT' )
243
+ return 'Value is not present' ;
250
244
return ;
251
245
}
252
246
247
+ if ( slotDefinition . value_presence === 'ABSENT' )
248
+ return 'Value is not absent' ;
249
+
253
250
let splitValues ;
254
251
if ( slotDefinition . multivalued ) {
255
252
splitValues = value . split ( this . #multivaluedDelimiter) ;
You can’t perform that action at this time.
0 commit comments