We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4754b21 commit e9d7d53Copy full SHA for e9d7d53
src/utility.ts
@@ -34,22 +34,10 @@ export const Binary = function (override = false, binary = '7z') {
34
* @return {string}
35
*/
36
export const Files = function (files: string | string[]): string {
37
- if (isUndefined(files)) {
38
- return '';
39
- }
40
-
41
- let toProcess = '';
42
43
- if (Array.isArray(files)) {
44
- files.forEach(function (f) {
45
- toProcess += '"' + f + '" ';
46
- });
47
- toProcess = toProcess.trim();
48
- } else {
49
- toProcess = '"' + files + '"';
50
51
52
- return toProcess;
+ if (isUndefined(files)) return '';
+ return (Array.isArray(files) ? files : [files])
+ .map((file) => `"${file}"`)
+ .join(' ');
53
};
54
55
/**
0 commit comments