Skip to content

Commit cb6b535

Browse files
committed
fix: remove the last slash of the target file
1 parent 577eb7a commit cb6b535

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"glob": "^7.1.6",
2828
"p-all": "^2.1.0",
2929
"p-retry": "^4.2.0",
30-
"qiniu": "^7.2.2"
30+
"qiniu": "^7.3.0"
3131
},
3232
"devDependencies": {
3333
"@types/jest": "^24.0.24",

src/upload.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import pAll from 'p-all';
55
import pRetry from 'p-retry';
66

77
function normalizePath(input: string): string {
8-
let val = input.replace(/^\//, '');
9-
if (!val.endsWith('/')) {
10-
val += '/';
11-
}
12-
return val;
8+
return input.replace(/^\//, '');
139
}
1410

1511
export function upload(

0 commit comments

Comments
 (0)