{"action":"opened","issue":{"url":"https://api.github.com/repos/chriso/validator.js/issues/508","repository_url":"https://api.github.com/repos/chriso/validator.js","labels_url":"https://api.github.com/repos/chriso/validator.js/issues/508/labels{/name}","comments_url":"https://api.github.com/repos/chriso/validator.js/issues/508/comments","events_url":"https://api.github.com/repos/chriso/validator.js/issues/508/events","html_url":"https://github.com/chriso/validator.js/issues/508","id":136121046,"number":508,"title":"validator string coercion","user":{"login":"mreinstein","id":718067,"avatar_url":"https://avatars.githubusercontent.com/u/718067?v=3","gravatar_id":"","url":"https://api.github.com/users/mreinstein","html_url":"https://github.com/mreinstein","followers_url":"https://api.github.com/users/mreinstein/followers","following_url":"https://api.github.com/users/mreinstein/following{/other_user}","gists_url":"https://api.github.com/users/mreinstein/gists{/gist_id}","starred_url":"https://api.github.com/users/mreinstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mreinstein/subscriptions","organizations_url":"https://api.github.com/users/mreinstein/orgs","repos_url":"https://api.github.com/users/mreinstein/repos","events_url":"https://api.github.com/users/mreinstein/events{/privacy}","received_events_url":"https://api.github.com/users/mreinstein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-24T16:58:03Z","updated_at":"2016-02-24T16:58:03Z","closed_at":null,"body":"pre `5.x.x` this code worked great in validator:\r\n\r\n```coffeescript\r\nvalidator = require 'validator'\r\nt =\r\n hello:\r\n   how: 'how'\r\n\r\nparam = validator.trim(validator.stripLow(t.hello.nope))\r\n```\r\n\r\nnow it throws `TypeError: This library (validator.js) validates strings only`\r\n\r\nOk, whatever. I coerce my string as the docs suggest:\r\n\r\n```coffeescript\r\nparam = validator.trim(validator.stripLow(t.hello.nope + ''))\r\n```\r\n\r\n`param` used to have an empty string if the parameter was missing, but now I always get `undefined` as a string.\r\n\r\nThis is kind of a big issue for optional parameters in an interface. \r\n\r\n"}}