12 lines
294 B
JavaScript
12 lines
294 B
JavaScript
|
function normalize (str) {
|
||
|
return str
|
||
|
.replace(/[\/]+/g, '/')
|
||
|
.replace(/\/\?/g, '?')
|
||
|
.replace(/\/\#/g, '#')
|
||
|
.replace(/\:\//g, '://');
|
||
|
}
|
||
|
|
||
|
module.exports = function () {
|
||
|
var joined = [].slice.call(arguments, 0).join('/');
|
||
|
return normalize(joined);
|
||
|
};
|