2
0

🛂 (radar) Enable multiple RADAR_CUMULATIVE_KEYWORDS sets

This commit is contained in:
Baptiste Arnaud
2024-01-08 14:34:35 +01:00
parent f3a4922286
commit 56e0342e86
2 changed files with 3 additions and 3 deletions

2
packages/env/env.ts vendored
View File

@ -79,7 +79,7 @@ const baseEnv = {
RADAR_CUMULATIVE_KEYWORDS: z
.string()
.min(1)
.transform((val) => val.split(','))
.transform((val) => val.split('/').map((s) => s.split(',')))
.optional(),
},
client: {

View File

@ -11,8 +11,8 @@ export const computeRiskLevel = (typebot: any) => {
)
return 100
if (
env.RADAR_CUMULATIVE_KEYWORDS?.every((keyword) =>
stringifiedTypebot.toLowerCase().includes(keyword)
env.RADAR_CUMULATIVE_KEYWORDS?.some((set) =>
set.every((keyword) => stringifiedTypebot.toLowerCase().includes(keyword))
)
)
return 100