« get me outta code hell

bind more utilities in bindUtilities - 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-01-10 17:01:54 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-10 17:01:54 -0400
commit4de56d21db5004e5b2c2a49caedee0908b9c6a9f (patch)
treedcea2b13432f0ee8d160914c2fbcf149a3cdca2b /src
parentd442546057f8280a141d4aa54f633a09c429e2d3 (diff)
bind more utilities in bindUtilities
Diffstat (limited to 'src')
-rw-r--r--src/write/bind-utilities.js14
-rw-r--r--src/write/build-modes/live-dev-server.js13
-rw-r--r--src/write/build-modes/static-build.js13
3 files changed, 20 insertions, 20 deletions
diff --git a/src/write/bind-utilities.js b/src/write/bind-utilities.js
index 1c4dd282..4b037a91 100644
--- a/src/write/bind-utilities.js
+++ b/src/write/bind-utilities.js
@@ -51,8 +51,11 @@ import {
 } from '../util/wiki-data.js';
 
 export function bindUtilities({
+  absoluteTo,
+  getSizeOfAdditionalFile,
   language,
   to,
+  urls,
   wikiData,
 }) {
   // TODO: Is there some nicer way to define these,
@@ -60,8 +63,15 @@ export function bindUtilities({
   // each page?
   const bound = {};
 
-  bound.html = html;
-  bound.language = language;
+  Object.assign(bound, {
+    absoluteTo,
+    getSizeOfAdditionalFile,
+    html,
+    language,
+    to,
+    urls,
+    wikiData,
+  })
 
   bound.img = bindOpts(img, {
     [bindOpts.bindIndex]: 0,
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index d481b480..b6bf662b 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -296,20 +296,15 @@ export async function go({
         ]));
 
       const bound = bindUtilities({
+        absoluteTo,
+        getSizeOfAdditionalFile,
         language,
         to,
+        urls,
         wikiData,
       });
 
-      const pageInfo = page.page({
-        ...bound,
-
-        absoluteTo,
-        to,
-        urls,
-
-        getSizeOfAdditionalFile,
-      });
+      const pageInfo = page.page(bound);
 
       const pageHTML = generateDocumentHTML(pageInfo, {
         cachebust,
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js
index c2bb02f2..dab2598a 100644
--- a/src/write/build-modes/static-build.js
+++ b/src/write/build-modes/static-build.js
@@ -309,20 +309,15 @@ export async function go({
         });
 
         const bound = bindUtilities({
+          absoluteTo,
+          getSizeOfAdditionalFile,
           language,
           to,
+          urls,
           wikiData,
         });
 
-        const pageInfo = page({
-          ...bound,
-
-          absoluteTo,
-          to,
-          urls,
-
-          getSizeOfAdditionalFile,
-        });
+        const pageInfo = page(bound);
 
         const oEmbedJSON = generateOEmbedJSON(pageInfo, {
           language,