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:
parent
c78e84dcbe
commit
7de8e4b45b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user