(fileName)
| 1 | export function sanitizeFileName(fileName) { |
| 2 | // Remove spaces and invalid characters |
| 3 | const file = fileName?.replace(/[^a-zA-Z0-9._-]/g, ""); |
| 4 | const removedot = file?.replace(/\.(?=.*\.)/g, ""); |
| 5 | return removedot?.replace(/[^a-zA-Z0-9._-]/g, ""); |
| 6 | } |
no outgoing calls
no test coverage detected