« get me outta code hell

infra: new 'multiple' option in quickEvaluate - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-04-04 13:29:00 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-04 13:29:00 -0300
commita93d8afa984f3a4cf5ad1064f8e991544b5ebc5d (patch)
tree42ae66ca6fb880db7cd463552fd1541b4237b3ff /src
parent07c9742601438a325349cfb051bc04c4df626291 (diff)
infra: new 'multiple' option in quickEvaluate
Diffstat (limited to 'src')
-rw-r--r--src/content-function.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/content-function.js b/src/content-function.js
index 377eecc9..30e0ccc3 100644
--- a/src/content-function.js
+++ b/src/content-function.js
@@ -338,7 +338,20 @@ export function quickEvaluate({
 
   name,
   args = [],
+  multiple = null,
 }) {
+  if (multiple !== null) {
+    return multiple.map(opts =>
+      quickEvaluate({
+        contentDependencies: allContentDependencies,
+        extraDependencies: allExtraDependencies,
+
+        ...opts,
+        name: opts.name ?? name,
+        args: opts.args ?? args,
+      }));
+  }
+
   const treeInfo = getRelationsTree(allContentDependencies, name, ...args);
   const flatTreeInfo = flattenRelationsTree(treeInfo);
   const {root, relationIdentifier, flatRelationSlots} = flatTreeInfo;