Skip to content

NaN printed in cosole as null #696

@rashtao

Description

@rashtao

This code:

var schema = Joi.object().keys({
        date: Joi.date().allow(null)
});

Joi.assert({date: NaN}, schema);

prints in the console:

Error: {
  "date" [1]: null
}

[1] "date" must be a number of milliseconds or valid date string

and could be really confusing to debug!

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions