(name)
| 42 | } |
| 43 | |
| 44 | function sanitizeFilename (name) { |
| 45 | const clean = String(name).trim() |
| 46 | if (!/^[\w.-]+$/.test(clean)) { |
| 47 | throw new Error( |
| 48 | `Refusing to continue: remote filename failed validation: "${name}"` |
| 49 | ) |
| 50 | } |
| 51 | return clean |
| 52 | } |
| 53 | |
| 54 | // --------------------------------------------------------------------------- |
| 55 | // Core helpers |
no outgoing calls
no test coverage detected