From 26333f43a7b72c09e498570dc2d494d9e15315b7 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 28 Jun 2020 01:19:00 +0200 Subject: [PATCH] Clarify error message for NaN --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index cf7fa59..60d9f73 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,6 @@ module.exports = function (value) { if (!isNumberObject(value)) { throw new ValidationError("Must be a number"); } else if (Number.isNaN(value)) { - throw new ValidationError(`Must not be NaN`); + throw new ValidationError(`Must be a number (must not be NaN)`); } };