Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no


  • node version: 16
  • module version: 17.7.0
  • environment (e.g. node, browser, native): browser
  • used with (e.g. hapi application, another framework, standalone, ...): React

How can we help?

I have an input that can be either a phone number or an email. I'm used alternatives.try to achieve this, but I want to have different message for when the input is empty string and when it's not empty but also doesn't match to phone or email. How can I do this? The alterntatvies.match just give the same message for both situations.

        Joi.string().email({ tlds: { allow: false } }),
        'alternatives.match': 'Invalid input',
© 2022 - All rights reserved.