Skip to content

Remove all arguments flattening #1644

@hueniverse

Description

@hueniverse

This is a relic of the very first API. There is no reason to support both method(arg1, arg2, arg3) and method([arg1, arg2, arg3]). With new language features for working with arrays and expanding them as arguments, we should only support method(arg1, arg2, arg3). It is much more readable.

Require single array argument:

  • Joi.alternatives()
  • Joi.alternatives().try()

No longer supports array arguments:

  • Joi.extend()
  • Joi.any().allow()
  • Joi.any().valid()
  • Joi.any().invalid()
  • Joi.array().items()
  • Joi.array().ordered()
  • Joi.boolean().truthy()
  • Joi.boolean().falsy()
  • Joi.object().xor()
  • Joi.object().or()
  • Joi.object().and()
  • Joi.object().nand()
  • Joi.object().requiredKeys()
  • Joi.object().optionalKeys()
  • Joi.object().forbiddenKeys()

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions