Browse Source

Clarify error message for NaN

master
Sven Slootweg 12 months ago
parent
commit
26333f43a7
  1. 2
      index.js

2
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)`);
}
};
Loading…
Cancel
Save