mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 02:57:20 +00:00
chore: run formatter
This commit is contained in:
parent
3ef89246ba
commit
3722393ec0
40 changed files with 13085 additions and 13040 deletions
|
@ -44,9 +44,7 @@ export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
|
|||
let pattern;
|
||||
|
||||
if (trigger.loose_matching) {
|
||||
pattern = [...word]
|
||||
.map((c) => escapeStringRegexp(c))
|
||||
.join(`[\\s\\-_.,!?]{0,${looseMatchingThreshold}}`);
|
||||
pattern = [...word].map((c) => escapeStringRegexp(c)).join(`[\\s\\-_.,!?]{0,${looseMatchingThreshold}}`);
|
||||
} else {
|
||||
pattern = escapeStringRegexp(word);
|
||||
}
|
||||
|
@ -62,10 +60,7 @@ export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
|
|||
return pattern;
|
||||
});
|
||||
|
||||
const mergedRegex = new RegExp(
|
||||
patterns.map((p) => `(${p})`).join("|"),
|
||||
trigger.case_sensitive ? "" : "i"
|
||||
);
|
||||
const mergedRegex = new RegExp(patterns.map((p) => `(${p})`).join("|"), trigger.case_sensitive ? "" : "i");
|
||||
|
||||
regexCache.set(trigger, [mergedRegex]);
|
||||
}
|
||||
|
@ -84,7 +79,7 @@ export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
|
|||
for (const regex of regexes) {
|
||||
const match = regex.exec(str);
|
||||
if (match) {
|
||||
const matchedWordIndex = match.slice(1).findIndex(group => group !== undefined);
|
||||
const matchedWordIndex = match.slice(1).findIndex((group) => group !== undefined);
|
||||
const matchedWord = trigger.words[matchedWordIndex];
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue