From 5aad4eae6629eaa1e4dd849b03abff8888afdb4d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 4 Nov 2023 21:01:48 -0300 Subject: data: validateWikiData: fix messaging for mismatch one-ref-type --- src/data/things/validators.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/things/validators.js b/src/data/things/validators.js index ea4303f..f60c363 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; -- cgit 1.3.0-6-gf8a5