« get me outta code hell

data: miscellaneous linkWikiDataArrays fixes - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-28 17:11:16 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-28 17:33:48 -0400
commite673e1d6983f05885cbc596e2fc19fa5d0f302ac (patch)
tree6aba2dedb461c58527a1a49ed3d7bf424cef820d
parenta8c4cbf7d0913ea3ac9086ada8b9042608f604e2 (diff)
data: miscellaneous linkWikiDataArrays fixes
Squashed from:

* data: fix misplaced return instead of yaml in linkWikiDataArrays
* data: more linkWikiDataArrays tolerance
* data: get rid of accidental .slice() in linkWikiDataArrays
-rw-r--r--src/data/yaml.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index c79ce53b..f2540b65 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -1594,11 +1594,10 @@ export function linkWikiDataArrays(wikiData, {
   ]);
 
   for (const [things, keys] of linkWikiDataSpec.entries()) {
-    if (things === undefined) return;
-    for (let i = 0; i < things.length; i++) {
-      const thing = things[i];
-      for (let j = 0; j < keys.length; j++) {
-        const key = keys[j];
+    if (things === undefined) continue;
+    for (const thing of things) {
+      if (thing === undefined) continue;
+      for (const key of keys) {
         if (!(key in wikiData)) continue;
         if (XXX_decacheWikiData) thing[key] = [];
         thing[key] = wikiData[key];