How to use the exist function from joi
Find comprehensive JavaScript joi.exist code examples handpicked from public code repositorys.
70 71 72 73 74 75 76 77 78 79
super(); const configJoi = joi.object({ zookeeper: joi.object({ connectionString: joi.string().required(), }).when('kafka.backlogMetrics', { is: joi.exist(), then: joi.required() }), kafka: joi.object({ hosts: joi.string().required(), backlogMetrics: { zkPath: joi.string().required(),
18
51
60
GitHub: postalsys/emailengine
3283 3284 3285 3286 3287 3288 3289 3290 3291
.max(MAX_ATTACHMENT_SIZE) .required() .example('R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=') .description('Base64 formatted attachment file') .when('reference', { is: Joi.exist().not(false, null), then: Joi.forbidden(), otherwise: Joi.required() }),
113
0
16
+ 80 other calls in file
GitHub: ustaxcourt/ef-cms
197 198 199 200 201 202 203 204 205 206
).required(), petitionFile: joi.object().required(), // object of type File petitionFileSize: JoiValidationConstants.MAX_FILE_SIZE_BYTES.when( 'petitionFile', { is: joi.exist().not(null), otherwise: joi.optional().allow(null), then: joi.required(), }, ),
36
72
19
+ 27 other calls in file
GitHub: ustaxcourt/ef-cms
491 492 493 494 495 496 497 498 499 500
.meta({ tags: ['Restricted'], }), caseType: JoiValidationConstants.STRING.valid(...CASE_TYPES).required(), closedDate: JoiValidationConstants.ISO_DATE.when('status', { is: joi.exist().valid(...CLOSED_CASE_STATUSES), otherwise: joi.optional(), then: joi.required(), }), correspondence: joi
36
72
19
+ 15 other calls in file
joi.string is the most popular function in joi (40578 examples)