Travis build: 1268

This commit is contained in:
30secondsofcode
2018-01-16 16:52:18 +00:00
parent 934bb0f079
commit d446ab4415
3 changed files with 50 additions and 8 deletions

View File

@ -6,13 +6,14 @@ Use `String.join('/')` to combine URL segments, then a series of `String.replace
```js
const URLJoin = (...args) =>
args.join('/')
.replace(/[\/]+/g,'/')
.replace(/^(.+):\//,'$1://')
.replace(/^file:/,'file:/')
.replace(/\/(\?|&|#[^!])/g, '$1')
.replace(/\?/g,'&')
.replace('&','?');
args
.join('/')
.replace(/[\/]+/g, '/')
.replace(/^(.+):\//, '$1://')
.replace(/^file:/, 'file:/')
.replace(/\/(\?|&|#[^!])/g, '$1')
.replace(/\?/g, '&')
.replace('&', '?');
```
```js