{"action":"created","issue":{"url":"https://api.github.com/repos/ansman/validate.js/issues/99","repository_url":"https://api.github.com/repos/ansman/validate.js","labels_url":"https://api.github.com/repos/ansman/validate.js/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/ansman/validate.js/issues/99/comments","events_url":"https://api.github.com/repos/ansman/validate.js/issues/99/events","html_url":"https://github.com/ansman/validate.js/issues/99","id":134470969,"number":99,"title":"Bug report: Poor empty value handling for default format validator?","user":{"login":"mondwan","id":3899555,"avatar_url":"https://avatars.githubusercontent.com/u/3899555?v=3","gravatar_id":"","url":"https://api.github.com/users/mondwan","html_url":"https://github.com/mondwan","followers_url":"https://api.github.com/users/mondwan/followers","following_url":"https://api.github.com/users/mondwan/following{/other_user}","gists_url":"https://api.github.com/users/mondwan/gists{/gist_id}","starred_url":"https://api.github.com/users/mondwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mondwan/subscriptions","organizations_url":"https://api.github.com/users/mondwan/orgs","repos_url":"https://api.github.com/users/mondwan/repos","events_url":"https://api.github.com/users/mondwan/events{/privacy}","received_events_url":"https://api.github.com/users/mondwan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-02-18T03:25:18Z","updated_at":"2016-08-24T08:40:50Z","closed_at":null,"body":"# Description\r\n\r\nGiven I need to validate value is not `empty`, for example\r\n\r\n* `''`: Invalid\r\n* `'     '`: Valid\r\n\r\n# Problems\r\n\r\nOption `presence` explicitly states `whitespaces only` is not a valid string. So I head to `format`.\r\n\r\nHowever, default format validator always allows empty value (empty defined above) at the beginner which ignores my regex object.\r\n\r\n# Reproduce the problem\r\n\r\nHere is the fiddle to demonstrate the problem: https://jsfiddle.net/8okbtbuz/\r\n\r\nGiven I have a regex `^.{1,64}$'` which ensures there is at least one character, `validator.single()` always treat the `empty` value is a valid one.\r\n\r\n# Problematic codes spotted\r\n\r\nhttps://github.com/ansman/validate.js/blob/master/validate.js#L948\r\n\r\nIt always return success for empty value. This is not good....."},"comment":{"url":"https://api.github.com/repos/ansman/validate.js/issues/comments/241996039","html_url":"https://github.com/ansman/validate.js/issues/99#issuecomment-241996039","issue_url":"https://api.github.com/repos/ansman/validate.js/issues/99","id":241996039,"user":{"login":"ansman","id":102883,"avatar_url":"https://avatars.githubusercontent.com/u/102883?v=3","gravatar_id":"","url":"https://api.github.com/users/ansman","html_url":"https://github.com/ansman","followers_url":"https://api.github.com/users/ansman/followers","following_url":"https://api.github.com/users/ansman/following{/other_user}","gists_url":"https://api.github.com/users/ansman/gists{/gist_id}","starred_url":"https://api.github.com/users/ansman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansman/subscriptions","organizations_url":"https://api.github.com/users/ansman/orgs","repos_url":"https://api.github.com/users/ansman/repos","events_url":"https://api.github.com/users/ansman/events{/privacy}","received_events_url":"https://api.github.com/users/ansman/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T08:40:49Z","updated_at":"2016-08-24T08:40:49Z","body":"@sckogi Datetime was changed here:\r\nhttps://github.com/ansman/validate.js/commit/75ec791d1e55f87d97588d87d034aa184e23445a#diff-ed60d8ad61ec5449dd72bc2b36d651e1L47\r\nhttps://github.com/ansman/validate.js/commit/75ec791d1e55f87d97588d87d034aa184e23445a#diff-de099361a37e0c86a01873666f829014L918\r\n\r\nI've made the changes here: 75ec791d1e55f87d97588d87d034aa184e23445a\r\n"}}
{"actor":{"display_login":"ansman"}}