schemas.js 639 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. // Load modules
  3. const Joi = require('../');
  4. // Declare internals
  5. const internals = {};
  6. exports.options = Joi.object({
  7. abortEarly: Joi.boolean(),
  8. convert: Joi.boolean(),
  9. allowUnknown: Joi.boolean(),
  10. skipFunctions: Joi.boolean(),
  11. stripUnknown: [Joi.boolean(), Joi.object({ arrays: Joi.boolean(), objects: Joi.boolean() }).or('arrays', 'objects')],
  12. language: Joi.object(),
  13. presence: Joi.string().only('required', 'optional', 'forbidden', 'ignore'),
  14. raw: Joi.boolean(),
  15. context: Joi.object(),
  16. strip: Joi.boolean(),
  17. noDefaults: Joi.boolean(),
  18. error: Joi.object()
  19. }).strict();