Skip to content

Commit 914963a

Browse files
committed
generateFileSystemSafeName: update variable name for string
1 parent c69579d commit 914963a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
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
}

0 commit comments

Comments
 (0)