diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-04 21:01:48 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-04 21:01:48 -0300 |
commit | 5aad4eae6629eaa1e4dd849b03abff8888afdb4d (patch) | |
tree | 193ebf76fb10eee5e659903f0810c1435b083f5e /src | |
parent | 9f4c3b913fa6b12a236cedf76abe120f0321f53e (diff) |
data: validateWikiData: fix messaging for mismatch one-ref-type
Diffstat (limited to 'src')
-rw-r--r-- | src/data/things/validators.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/data/things/validators.js b/src/data/things/validators.js index ea4303fc..f60c363c 100644 --- a/src/data/things/validators.js +++ b/src/data/things/validators.js @@ -484,8 +484,10 @@ export function validateWikiData({ throw new TypeError(`Expected array of unmixed reference types, got multiple: ${types()}`); } - if (referenceType && !allRefTypes.has(referenceType)) { - throw new TypeError(`Expected array of ${referenceType}, got array of ${allRefTypes[0]}`) + const onlyRefType = Array.from(allRefTypes)[0]; + + if (referenceType && onlyRefType !== referenceType) { + throw new TypeError(`Expected array of ${referenceType}, got array of ${onlyRefType}`) } OK = true; return true; |