0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

refactor: 🔨 change arguments to rest parameter

This commit is contained in:
Meeeeow 2017-12-02 23:27:33 +08:00 committed by juanpicado
parent 48459b50ac
commit 136de84cc5

View file

@ -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`);
};