{"action":"created","issue":{"url":"https://api.github.com/repos/skaterdav85/validatorjs/issues/118","repository_url":"https://api.github.com/repos/skaterdav85/validatorjs","labels_url":"https://api.github.com/repos/skaterdav85/validatorjs/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/skaterdav85/validatorjs/issues/118/comments","events_url":"https://api.github.com/repos/skaterdav85/validatorjs/issues/118/events","html_url":"https://github.com/skaterdav85/validatorjs/issues/118","id":169796390,"number":118,"title":"Custom Validation Doesn't Execute","user":{"login":"bricox","id":594708,"avatar_url":"https://avatars.githubusercontent.com/u/594708?v=3","gravatar_id":"","url":"https://api.github.com/users/bricox","html_url":"https://github.com/bricox","followers_url":"https://api.github.com/users/bricox/followers","following_url":"https://api.github.com/users/bricox/following{/other_user}","gists_url":"https://api.github.com/users/bricox/gists{/gist_id}","starred_url":"https://api.github.com/users/bricox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bricox/subscriptions","organizations_url":"https://api.github.com/users/bricox/orgs","repos_url":"https://api.github.com/users/bricox/repos","events_url":"https://api.github.com/users/bricox/events{/privacy}","received_events_url":"https://api.github.com/users/bricox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-07T13:30:01Z","updated_at":"2016-08-08T00:14:45Z","closed_at":null,"body":"I've written a custom validation rule, but have discovered that it doesn't execute if the value that needs to be verified is null or an empty string.  \r\n\r\nFor example, this does not execute the validation rule.  \r\n\r\nValidator.register('telephone', function(val) {            \r\n      return val.match(/^\\d{3}-\\d{3}-\\d{4}$/);\r\n    });\r\n\r\nvar validator = new Validator({\r\n      phone: ''\r\n    }, {\r\n      phone: 'telephone'\r\n    });\r\n\r\nIs this the intended behavior?  It seems to me that this should still run.\r\n"},"comment":{"url":"https://api.github.com/repos/skaterdav85/validatorjs/issues/comments/238118320","html_url":"https://github.com/skaterdav85/validatorjs/issues/118#issuecomment-238118320","issue_url":"https://api.github.com/repos/skaterdav85/validatorjs/issues/118","id":238118320,"user":{"login":"skaterdav85","id":687449,"avatar_url":"https://avatars.githubusercontent.com/u/687449?v=3","gravatar_id":"","url":"https://api.github.com/users/skaterdav85","html_url":"https://github.com/skaterdav85","followers_url":"https://api.github.com/users/skaterdav85/followers","following_url":"https://api.github.com/users/skaterdav85/following{/other_user}","gists_url":"https://api.github.com/users/skaterdav85/gists{/gist_id}","starred_url":"https://api.github.com/users/skaterdav85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skaterdav85/subscriptions","organizations_url":"https://api.github.com/users/skaterdav85/orgs","repos_url":"https://api.github.com/users/skaterdav85/repos","events_url":"https://api.github.com/users/skaterdav85/events{/privacy}","received_events_url":"https://api.github.com/users/skaterdav85/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T00:14:45Z","updated_at":"2016-08-08T00:14:45Z","body":"Ya this is the intended behavior. The rule would need to be used in conjunction with the \"required\" rule."}}
{"actor":{"display_login":"skaterdav85"}}