« get me outta code hell

language: refactor languageOptionRegex - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-12 08:27:54 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-12 08:27:54 -0300
commit070afce1ef75dac965e979536b0ac7a9170607df (patch)
tree9d3802437279c73de6c7bab7243719d3fdec3355 /src/data/things
parentad349c3a6949d8e6751ada62f297038336b1bcc6 (diff)
language: refactor languageOptionRegex
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/language.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/data/things/language.js b/src/data/things/language.js
index 5573ce28..78ac422d 100644
--- a/src/data/things/language.js
+++ b/src/data/things/language.js
@@ -17,6 +17,8 @@ import {
 
 import {externalFunction, flag, name} from '#composite/wiki-properties';
 
+export const languageOptionRegex = /{(?<name>[A-Z0-9_]+)}/g;
+
 export class Language extends Thing {
   static [Thing.getPropertyDescriptors] = () => ({
     // Update & expose
@@ -201,7 +203,7 @@ export class Language extends Thing {
     const output = this.#iterateOverTemplate({
       template: this.strings[key],
 
-      match: /{(?<name>[A-Z0-9_]+)}/g,
+      match: languageOptionRegex,
 
       insert: ({name: optionName}, canceledForming) => {
         if (optionsMap.has(optionName)) {