Add URLJoin.md
This commit is contained in:
8
test/URLJoin/URLJoin.js
Normal file
8
test/URLJoin/URLJoin.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = URLJoin = (...args) =>
|
||||
args.join('/')
|
||||
.replace(/[\/]+/g,'/')
|
||||
.replace(/^(.+):\//,'$1://')
|
||||
.replace(/^file:/,'file:/')
|
||||
.replace(/\/(\?|&|#[^!])/g, '$1')
|
||||
.replace(/\?/g,'&')
|
||||
.replace('&','?');
|
||||
Reference in New Issue
Block a user