From 8ffc5b9ae95838d61670222137f89e9d0087384e Mon Sep 17 00:00:00 2001 From: Elvey Date: Tue, 27 Jun 2017 12:56:55 +0930 Subject: [PATCH] Ensure value is string before validating format --- lib/revalidator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/revalidator.js b/lib/revalidator.js index 58476b0..d6e26a2 100644 --- a/lib/revalidator.js +++ b/lib/revalidator.js @@ -275,7 +275,7 @@ } } - if (schema.format && options.validateFormats) { + if (schema.format && options.validateFormats && typeof value === 'string') { format = schema.format; if (options.validateFormatExtensions) { spec = validate.formatExtensions[format] }