« get me outta code hell

content: generateListingPage: don't mutate options in slots - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-28 09:57:50 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-28 09:57:50 -0300
commit168425e7a3dd3a268cfdbd2a395e11ac72eaa3b2 (patch)
treeb5aa42c031cd489765d202638550f75678d298bc /src/content
parentf12605331f60796da178f3d4b7bbc096f02b0d48 (diff)
content: generateListingPage: don't mutate options in slots
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateListingPage.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/content/dependencies/generateListingPage.js b/src/content/dependencies/generateListingPage.js
index 4de2d006..3c50bd59 100644
--- a/src/content/dependencies/generateListingPage.js
+++ b/src/content/dependencies/generateListingPage.js
@@ -91,12 +91,13 @@ export default {
 
       const parts = [baseStringsKey, contextStringsKey];
 
-      if (options.stringsKey) {
+      const {stringsKey, ...passOptions} = options;
+
+      if (stringsKey) {
         parts.push(options.stringsKey);
-        delete options.stringsKey;
       }
 
-      return language.formatString(parts.join('.'), options);
+      return language.formatString(parts.join('.'), passOptions);
     };
 
     return relations.layout.slots({