File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11/**
2- * generate file system safe string for a given string
2+ * generate file system safe string for a given name
33 * that can be used as a valid file name
44 * in all operating systems
5- * @param {String } string
5+ * @param {String } originalName
66 * @param {String } replacer (optional) character to replace invalid characters
77 */
8- export function generateFileSystemSafeName ( string : string , replacer : string ) {
8+ export function generateFileSystemSafeName (
9+ originalName : string ,
10+ replacer : string
11+ ) {
912 // from here https://serverfault.com/a/242134
1013 const INVALID_CHARS_REGEX = / [ * / ? : \\ < > | " \u0000 - \u001F ] / g; // eslint-disable-line
11- const slug = string . replace ( INVALID_CHARS_REGEX , replacer || '' ) ;
14+ const slug = originalName . replace ( INVALID_CHARS_REGEX , replacer || '' ) ;
1215
1316 return slug ;
1417}
You can’t perform that action at this time.
0 commit comments