diff --git a/src/utils/string.js b/src/utils/string.js index 6ebd9ec74..1c41996d8 100644 --- a/src/utils/string.js +++ b/src/utils/string.js @@ -1,5 +1,5 @@ /* eslint prefer-rest-params:off */ -module.exports.spliceURL = function spliceURL() { - return Array.from(arguments).reduce((lastResult, current) => lastResult + current).replace(/([^:])(\/)+(.)/g, `$1/$3`); +export const spliceURL = function spliceURL(...args) { + return Array.from(args).reduce((lastResult, current) => lastResult + current).replace(/([^:])(\/)+(.)/g, `$1/$3`); };