@@ -80,49 +80,65 @@ yarn add parse-url
80
80
const parseUrl = require (" parse-url" )
81
81
82
82
console .log (parseUrl (" http://ionicabizau.net/blog" ))
83
- // { protocols: [ 'http' ],
83
+ // {
84
+ // protocols: [ 'http' ],
84
85
// protocol: 'http',
85
- // port: null ,
86
+ // port: '' ,
86
87
// resource: 'ionicabizau.net',
87
88
// user: '',
89
+ // password: '',
88
90
// pathname: '/blog',
89
91
// hash: '',
90
92
// search: '',
91
- // href: 'http://ionicabizau.net/blog' }
93
+ // href: 'http://ionicabizau.net/blog',
94
+ // query: {}
95
+ // }
92
96
93
97
console .log (parseUrl (" http://domain.com/path/name?foo=bar&bar=42#some-hash" ))
94
- // { protocols: [ 'http' ],
98
+ // {
99
+ // protocols: [ 'http' ],
95
100
// protocol: 'http',
96
- // port: null ,
101
+ // port: '' ,
97
102
// resource: 'domain.com',
98
103
// user: '',
104
+ // password: '',
99
105
// pathname: '/path/name',
100
106
// hash: 'some-hash',
101
107
// search: 'foo=bar&bar=42',
102
- // href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' }
108
+ // href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash',
109
+ // query: { foo: 'bar', bar: '42' }
110
+ // }
103
111
104
112
// If you want to parse fancy Git urls, turn off the automatic url normalization
105
113
console .
log (
parseUrl (
" git+ssh://[email protected] /path/name.git" ,
false ))
106
- // { protocols: [ 'git', 'ssh' ],
114
+ // {
115
+ // protocols: [ 'git', 'ssh' ],
107
116
// protocol: 'git',
108
- // port: null ,
117
+ // port: '' ,
109
118
// resource: 'host.xz',
110
119
// user: 'git',
120
+ // password: '',
111
121
// pathname: '/path/name.git',
112
122
// hash: '',
113
123
// search: '',
114
- // href: 'git+ssh://[email protected] /path/name.git' }
124
+ // href: 'git+ssh://[email protected] /path/name.git',
125
+ // query: {}
126
+ // }
115
127
116
128
console .
log (
parseUrl (
" [email protected] :IonicaBizau/git-stats.git" ,
false ))
117
- // { protocols: [],
129
+ // {
130
+ // protocols: [ 'ssh' ],
118
131
// protocol: 'ssh',
119
- // port: null ,
132
+ // port: '' ,
120
133
// resource: 'github.com',
121
134
// user: 'git',
135
+ // password: '',
122
136
// pathname: '/IonicaBizau/git-stats.git',
123
137
// hash: '',
124
138
// search: '',
125
- // href: '[email protected] :IonicaBizau/git-stats.git' }
139
+ // href: '[email protected] :IonicaBizau/git-stats.git',
140
+ // query: {}
141
+ // }
126
142
```
127
143
128
144
0 commit comments