diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/data/things/validators.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/data/things/validators.js b/src/data/things/validators.js index b116120a..b26de86b 100644 --- a/src/data/things/validators.js +++ b/src/data/things/validators.js @@ -112,7 +112,12 @@ export function isInstance(value, constructor) { } export function isDate(value) { - return isInstance(value, Date); + isInstance(value, Date); + + if (isNaN(value)) + throw new TypeError(`Expected valid date`); + + return true; } export function isObject(value) { |