2
0

(radar) Add radar cumulative keyword alternatives check

This commit is contained in:
Baptiste Arnaud
2024-01-15 10:13:55 +01:00
parent b412f0e4dc
commit 0b00fa7533
3 changed files with 15 additions and 3 deletions

View File

@@ -13,8 +13,10 @@ export const computeRiskLevel = (typebot: any) => {
if (
env.RADAR_CUMULATIVE_KEYWORDS?.some((set) =>
set.every((keyword) =>
new RegExp(`(?<!https?://[^\\s"]*)\\b${keyword}\\b`, 'gi').test(
stringifiedTypebot
keyword.some((k) =>
new RegExp(`(?<!https?://[^\\s"]*)\\b${k}\\b`, 'gi').test(
stringifiedTypebot
)
)
)
)

View File

@@ -0,0 +1,8 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"include": ["**/*.ts"],
"exclude": ["node_modules"],
"compilerOptions": {
"target": "ES2015"
}
}