diff --git a/CHANGELOG.md b/CHANGELOG.md index db36dbc..febbc8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 0.3.1(Feb 18, 2016) +- Coerce input to string when using validator.js helpers + ### 0.3.0(Feb 13, 2016) - Optional validations support diff --git a/lib/validations.js b/lib/validations.js index 6a248e3..ffbe620 100644 --- a/lib/validations.js +++ b/lib/validations.js @@ -23,7 +23,7 @@ function checkParam(paramName, message, validator) { return { field: paramName, message: "\""+ paramName +"\" " + message, - result: validator.apply(null, [param].concat(extraArgs)) + result: validator.apply(null, [param + ""].concat(extraArgs)) } } } diff --git a/package.json b/package.json index adc900a..c68a5e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "property-validator", - "version": "0.3.0", + "version": "0.3.1", "description": "Easy property validation for JavaScript, Node and Express.", "main": "index.js", "homepage": "http://github.com/nettofarah/property-validator",