Fix lint and prettier
This commit is contained in:
@@ -9,7 +9,7 @@ export function escapeQuotes(str: string) {
|
||||
|
||||
// Escape regex special characters
|
||||
export function escapeRegExp(str: string) {
|
||||
return str.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
return str.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
||||
}
|
||||
|
||||
export function fillTemplate(template: string, variables: VariableMap): string {
|
||||
|
||||
@@ -80,7 +80,9 @@ export const runOneEval = async (
|
||||
|
||||
const stringifiedMessage = message.content ?? JSON.stringify(message.function_call);
|
||||
|
||||
const matchRegex = escapeRegExp(fillTemplate(escapeQuotes(evaluation.value), scenario.variableValues as VariableMap));
|
||||
const matchRegex = escapeRegExp(
|
||||
fillTemplate(escapeQuotes(evaluation.value), scenario.variableValues as VariableMap),
|
||||
);
|
||||
|
||||
switch (evaluation.evalType) {
|
||||
case "CONTAINS":
|
||||
|
||||
Reference in New Issue
Block a user