diff options
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 |
commit | 070afce1ef75dac965e979536b0ac7a9170607df (patch) | |
tree | 9d3802437279c73de6c7bab7243719d3fdec3355 /src/data | |
parent | ad349c3a6949d8e6751ada62f297038336b1bcc6 (diff) |
language: refactor languageOptionRegex
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/things/language.js | 4 |
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)) { |