Fix loose matching for automod (#428)

Added a missing closing bracket for the regex to work.

Co-authored-by: Almeida <github@almeidx.dev>
This commit is contained in:
hawkeye7662 2023-12-29 17:59:28 +05:30 committed by GitHub
parent e7eacb330b
commit 1cb8431a02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,7 +54,7 @@ export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
const looseMatchingThreshold = Math.min(Math.max(trigger.loose_matching_threshold, 1), 64); const looseMatchingThreshold = Math.min(Math.max(trigger.loose_matching_threshold, 1), 64);
const patterns = trigger.words.map((word) => { const patterns = trigger.words.map((word) => {
let pattern = trigger.loose_matching let pattern = trigger.loose_matching
? [...word].map((c) => escapeStringRegexp(c)).join(`(?:\\s*|.{0,${looseMatchingThreshold})`) ? [...word].map((c) => escapeStringRegexp(c)).join(`(?:\\s*|.{0,${looseMatchingThreshold}})`)
: escapeStringRegexp(word); : escapeStringRegexp(word);
if (trigger.only_full_words) { if (trigger.only_full_words) {