From ab0889eb8b2fff6fc9fc746817ecf90183dc2c1c Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 8 Aug 2020 13:37:59 +0200 Subject: [PATCH] Return instead of throw --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ac878e2..7705e5a 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,6 @@ const isString = require("is-string"); module.exports = function (value) { if (!isString(value)) { - throw new ValidationError("Must be a string"); + return new ValidationError("Must be a string"); } };