Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(form): replace all rule token instances in prompt message
Within the prompt property method of the form module, I updated the replace calls, where it replaces contextual tokens relating to the rules definition, to use a regular expression of the same respective values in order to have it replace all tokens present in the prompt text. The tokens used are the following: identifier name ruleValue If one uses a singular token multiple times in the prompt, for example, { type: 'levelCheck[2]', prompt: 'Level {ruleValue} not detected. Please ensure that {name} is set to a level at least equal to {ruleValue}.' } the first token of {ruleValue} is successfully replaced, but the subsequent {ruleValue} isn't. This change merely applies a regex with the "global" flag set in order to replace multiple tokens of the same name found in the prompt text.
- Loading branch information