Skip to content

Commit b24086e

Browse files
Merge pull request #407 from OpenSignLabs/prafull-opensignlabs-patch-1
2 parents 137f371 + a4a0630 commit b24086e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
function sanitizeFileName(fileName) {
22
// Remove spaces and invalid characters
3-
return fileName.replace(/[^a-zA-Z0-9._-]/g, "");
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, "");
46
}
57
export default sanitizeFileName;

0 commit comments

Comments
 (0)