Skip to content

Split validate() to sync and async versions #1998

@jakearchibald

Description

@jakearchibald

Context

  • node version: N/A
  • joi version: HEAD
  • environment (node, browser): N/A
  • used with (hapi, standalone, ...): N/A
  • any other relevant information:
const result = joi.validate(value, schema);

result is a thennable, despite validate being synchronous. It seems like the callback has been removed from the upcoming v16, and it seems like the 'thennable' should be removed too.

validate already returns its result synchronously (via result.error and result.value), so going genuinely async would be a breaking change anyway.

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codefeatureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions