« get me outta code hell

sugar, checks: withNestedProp+filterReferenceErrors: enter arrays - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-11 09:45:49 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-02-12 07:24:09 -0400
commit0eb70fd321af7bd2a52ea5b8a614321397f794c0 (patch)
treeae0f0169b97ce54abf89b746a68c0f05cb503f9b /src/data
parentd77095e5b559610b57690505fe1c467664782422 (diff)
sugar, checks: withNestedProp+filterReferenceErrors: enter arrays
Diffstat (limited to 'src/data')
-rw-r--r--src/data/checks.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/data/checks.js b/src/data/checks.js
index 9a859165..57d0c1a4 100644
--- a/src/data/checks.js
+++ b/src/data/checks.js
@@ -237,7 +237,7 @@ export function filterReferenceErrors(wikiData, {
   const aggregate = openAggregate({message: `Errors validating between-thing references in data`});
   for (const [thingDataProp, propSpec] of referenceSpec) {
     const thingData = getNestedProp(wikiData, thingDataProp);
-    const things = Array.isArray(thingData) ? thingData : [thingData];
+    const things = Array.isArray(thingData) ? thingData.flat(Infinity) : [thingData];
     aggregate.nest({message: `Reference errors in ${colors.green('wikiData.' + thingDataProp)}`}, ({nest}) => {
       for (const thing of things) {
         nest({message: `Reference errors in ${inspect(thing)}`}, ({nest, push, filter}) => {