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 RADAR_CUMULATIVE_KEYWORDS: z
.string() .string()
.min(1) .min(1)
.transform((val) => val.split(',')) .transform((val) => val.split('/').map((s) => s.split(',')))
.optional(), .optional(),
}, },
client: { client: {

View File

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