« get me outta code hell

rename strings arg to language - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-05-10 20:39:43 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-05-10 20:39:43 -0300
commit7056fa7c07ae08f5596c9ef8d8582642890bd764 (patch)
treec21b9e5950185378b90db07bde0143839533990c /src/util
parent2fa9baf09753243cc223859c06abad8abfc9bf2a (diff)
rename strings arg to language
Diffstat (limited to 'src/util')
-rw-r--r--src/util/replacer.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/replacer.js b/src/util/replacer.js
index 0066d218..b29044f2 100644
--- a/src/util/replacer.js
+++ b/src/util/replacer.js
@@ -319,7 +319,7 @@ export function parseInput(input) {
 }
 
 function evaluateTag(node, opts) {
-    const { find, input, link, replacerSpec, strings, to, wikiData } = opts;
+    const { find, input, language, link, replacerSpec, to, wikiData } = opts;
 
     const source = input.slice(node.i, node.iEnd);
 
@@ -382,7 +382,7 @@ function evaluateTag(node, opts) {
         : link[linkKey]);
 
     try {
-        return fn(value, {text: label, hash, args, strings, to});
+        return fn(value, {text: label, hash, args, language, to});
     } catch (error) {
         logError`The link ${source} failed to be processed: ${error}`;
         return source;
@@ -416,14 +416,14 @@ function transformNodes(nodes, opts) {
     return nodes.map(node => transformNode(node, opts)).join('');
 }
 
-export function transformInline(input, {replacerSpec, find, link, strings, to, wikiData}) {
+export function transformInline(input, {replacerSpec, find, link, language, to, wikiData}) {
     if (!replacerSpec) throw new Error('Expected replacerSpec');
     if (!find) throw new Error('Expected find');
     if (!link) throw new Error('Expected link');
-    if (!strings) throw new Error('Expected strings');
+    if (!language) throw new Error('Expected language');
     if (!to) throw new Error('Expected to');
     if (!wikiData) throw new Error('Expected wikiData');
 
     const nodes = parseInput(input);
-    return transformNodes(nodes, {input, find, link, replacerSpec, strings, to, wikiData});
+    return transformNodes(nodes, {input, find, link, replacerSpec, language, to, wikiData});
 }