diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-20 13:01:25 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-20 13:01:25 -0300 |
commit | 8db50e29b5a1cfddfddf499129b697ecabfadcb0 (patch) | |
tree | 20264a070f6f010a719fa4ea1937eaa1fa1b34b1 /src/data/things/validators.js | |
parent | 86679ee48eee7e1000b2b2f35e4c3d1a8d1be143 (diff) |
data: moar WIP composite syntax!
Diffstat (limited to 'src/data/things/validators.js')
-rw-r--r-- | src/data/things/validators.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/data/things/validators.js b/src/data/things/validators.js index f0d1d9fd..cd4c2b46 100644 --- a/src/data/things/validators.js +++ b/src/data/things/validators.js @@ -9,11 +9,11 @@ function inspect(value) { // Basic types (primitives) -function a(noun) { +export function a(noun) { return /[aeiou]/.test(noun[0]) ? `an ${noun}` : `a ${noun}`; } -function isType(value, type) { +export function isType(value, type) { if (typeof value !== type) throw new TypeError(`Expected ${a(type)}, got ${typeof value}`); |