1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00

feat: sanitize impact metrics

This commit is contained in:
kwasniew 2025-07-17 11:56:43 +02:00
parent c78e84dcbe
commit 7de8e4b45b
No known key found for this signature in database
GPG Key ID: 43A7CBC24C119560

View File

@ -20,10 +20,8 @@ export class MetricsTranslator {
}
sanitizeName(name: string): string {
// Replace any character that's not a letter, number, or underscore with an underscore
const regex = /[^a-zA-Z0-9_]/g;
// Replace any invalid characters with underscores
const sanitized = name.replace(regex, '_');
return sanitized;