Skip to content

Joi.number allows Infinity #494

@dbrockman

Description

@dbrockman

Feature request for a breaking change. Joi version 4.9.0

I'm not sure if this is the desired behaviour or not. It seems to me like Infinity should be rejected just like NaN.

This seems a bit awkward in order to validate that the value is a finite number:

joi.number().invalid(Infinity, -Infinity)

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