« get me outta code hell

data steps: implement leftover data unit test TODOs - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-03-27 09:45:16 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-03-27 09:45:16 -0300
commit789a26aacfd1e9f97a9395f0000b42df35a75bd7 (patch)
treec1233259fbddc372ed732ba0bc24bbcab0b0f73c /src
parent4e6f3c16818d9beb200c337d48c8ae2470a322ee (diff)
data steps: implement leftover data unit test TODOs
Diffstat (limited to 'src')
-rw-r--r--src/data/things/validators.js7
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) {