|
2 | 2 | const parsePath = require("../lib") |
3 | 3 |
|
4 | 4 | console.log(parsePath("http://ionicabizau.net/blog")) |
5 | | -// { protocols: [ 'http' ], |
| 5 | +// { |
| 6 | +// protocols: [ 'http' ], |
6 | 7 | // protocol: 'http', |
7 | | -// port: null, |
| 8 | +// port: '', |
8 | 9 | // resource: 'ionicabizau.net', |
9 | 10 | // user: '', |
| 11 | +// password: '', |
10 | 12 | // pathname: '/blog', |
11 | 13 | // hash: '', |
12 | 14 | // search: '', |
13 | | -// href: 'http://ionicabizau.net/blog' } |
| 15 | +// href: 'http://ionicabizau.net/blog', |
| 16 | +// query: {} |
| 17 | +// } |
14 | 18 |
|
15 | 19 | console.log(parsePath("http://domain.com/path/name?foo=bar&bar=42#some-hash")) |
16 | | -// { protocols: [ 'http' ], |
| 20 | +// { |
| 21 | +// protocols: [ 'http' ], |
17 | 22 | // protocol: 'http', |
18 | | -// port: null, |
| 23 | +// port: '', |
19 | 24 | // resource: 'domain.com', |
20 | 25 | // user: '', |
| 26 | +// password: '', |
21 | 27 | // pathname: '/path/name', |
22 | 28 | // hash: 'some-hash', |
23 | 29 | // search: 'foo=bar&bar=42', |
24 | | -// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' } |
| 30 | +// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash', |
| 31 | +// query: { foo: 'bar', bar: '42' } |
| 32 | +// } |
25 | 33 |
|
26 | 34 | console.log(parsePath("git+ssh://git@host.xz/path/name.git")) |
27 | | -// { protocols: [ 'git', 'ssh' ], |
| 35 | +// { |
| 36 | +// protocols: [ 'git', 'ssh' ], |
28 | 37 | // protocol: 'git', |
29 | | -// port: null, |
| 38 | +// port: '', |
30 | 39 | // resource: 'host.xz', |
31 | 40 | // user: 'git', |
| 41 | +// password: '', |
32 | 42 | // pathname: '/path/name.git', |
33 | 43 | // hash: '', |
34 | 44 | // search: '', |
35 | | -// href: 'git+ssh://git@host.xz/path/name.git' } |
36 | | - |
37 | | -console.log(parsePath("git@github.com:IonicaBizau/git-stats.git")) |
38 | | -// { protocols: [], |
39 | | -// protocol: 'ssh', |
40 | | -// port: null, |
41 | | -// resource: 'github.com', |
42 | | -// user: 'git', |
43 | | -// pathname: '/IonicaBizau/git-stats.git', |
44 | | -// hash: '', |
45 | | -// search: '', |
46 | | -// href: 'git@github.com:IonicaBizau/git-stats.git' } |
| 45 | +// href: 'git+ssh://git@host.xz/path/name.git', |
| 46 | +// query: {} |
| 47 | +// } |
0 commit comments