Neutralizes path traversal from untrusted ids interpolated into snapshot filenames.
(value: string)
| 32 | |
| 33 | /** Neutralizes path traversal from untrusted ids interpolated into snapshot filenames. */ |
| 34 | function sanitizeFilenameComponent(value: string): string { |
| 35 | return value.replace(/[^a-zA-Z0-9_-]/g, '_') |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Normalizes snapshot timestamps for filenames: keeps digits, `T`, and `-`, maps other separators to `-`, |
no outgoing calls
no test coverage detected