{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/joi/issues/696","labels_url":"https://api.github.com/repos/hapijs/joi/issues/696/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/joi/issues/696/comments","events_url":"https://api.github.com/repos/hapijs/joi/issues/696/events","html_url":"https://github.com/hapijs/joi/issues/696","id":97079096,"number":696,"title":"NaN printed in cosole as null","user":{"login":"rashtao","id":1259903,"avatar_url":"https://avatars.githubusercontent.com/u/1259903?v=3","gravatar_id":"","url":"https://api.github.com/users/rashtao","html_url":"https://github.com/rashtao","followers_url":"https://api.github.com/users/rashtao/followers","following_url":"https://api.github.com/users/rashtao/following{/other_user}","gists_url":"https://api.github.com/users/rashtao/gists{/gist_id}","starred_url":"https://api.github.com/users/rashtao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashtao/subscriptions","organizations_url":"https://api.github.com/users/rashtao/orgs","repos_url":"https://api.github.com/users/rashtao/repos","events_url":"https://api.github.com/users/rashtao/events{/privacy}","received_events_url":"https://api.github.com/users/rashtao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hapijs/joi/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"Marsup","id":796194,"avatar_url":"https://avatars.githubusercontent.com/u/796194?v=3","gravatar_id":"","url":"https://api.github.com/users/Marsup","html_url":"https://github.com/Marsup","followers_url":"https://api.github.com/users/Marsup/followers","following_url":"https://api.github.com/users/Marsup/following{/other_user}","gists_url":"https://api.github.com/users/Marsup/gists{/gist_id}","starred_url":"https://api.github.com/users/Marsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marsup/subscriptions","organizations_url":"https://api.github.com/users/Marsup/orgs","repos_url":"https://api.github.com/users/Marsup/repos","events_url":"https://api.github.com/users/Marsup/events{/privacy}","received_events_url":"https://api.github.com/users/Marsup/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-07-24T15:37:36Z","updated_at":"2015-10-06T16:01:23Z","closed_at":null,"body":"This code:\r\n\r\n```js\r\nvar schema = Joi.object().keys({\r\n        date: Joi.date().allow(null)\r\n});\r\n\r\nJoi.assert({date: NaN}, schema);\r\n```\r\n\r\nprints in the console:\r\n\r\n```text\r\nError: {\r\n  \"date\" [1]: null\r\n}\r\n\r\n[1] \"date\" must be a number of milliseconds or valid date string\r\n```\r\n\r\nand could be really confusing to debug!\r\n"},"comment":{"url":"https://api.github.com/repos/hapijs/joi/issues/comments/145910283","html_url":"https://github.com/hapijs/joi/issues/696#issuecomment-145910283","issue_url":"https://api.github.com/repos/hapijs/joi/issues/696","id":145910283,"user":{"login":"mdibaiee","id":2807772,"avatar_url":"https://avatars.githubusercontent.com/u/2807772?v=3","gravatar_id":"","url":"https://api.github.com/users/mdibaiee","html_url":"https://github.com/mdibaiee","followers_url":"https://api.github.com/users/mdibaiee/followers","following_url":"https://api.github.com/users/mdibaiee/following{/other_user}","gists_url":"https://api.github.com/users/mdibaiee/gists{/gist_id}","starred_url":"https://api.github.com/users/mdibaiee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdibaiee/subscriptions","organizations_url":"https://api.github.com/users/mdibaiee/orgs","repos_url":"https://api.github.com/users/mdibaiee/repos","events_url":"https://api.github.com/users/mdibaiee/events{/privacy}","received_events_url":"https://api.github.com/users/mdibaiee/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T16:01:23Z","updated_at":"2015-10-06T16:01:23Z","body":"@Marsup I searched for this issue, the only \"workaround\" seems to be transforming NaN and Infinity to their string equivalents and then transforming them back while doing `JSON.parse`. Although I think we don't need the `parse` case here, as we're only printing it out.\r\n\r\nIf you think we would use this, I'd be happy to make a PR."}}