Skip to content

Commit f2b79ca

Browse files
committed
Updated docs
1 parent 4ebc6ed commit f2b79ca

File tree

4 files changed

+78
-61
lines changed

4 files changed

+78
-61
lines changed

DOCUMENTATION.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ Parses the input url.
1111

1212
#### Return
1313
- **Object** An object containing the following fields:
14-
- `protocols` (Array): An array with the url protocols (usually it has one element).
15-
- `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`.
16-
- `port` (null|Number): The domain port.
17-
- `resource` (String): The url domain (including subdomains).
18-
- `user` (String): The authentication user (usually for ssh urls).
19-
- `pathname` (String): The url pathname.
20-
- `hash` (String): The url hash.
21-
- `search` (String): The url querystring value.
22-
- `href` (String): The input url.
23-
- `query` (Object): The url querystring, parsed as object.
14+
- `protocols` (Array): An array with the url protocols (usually it has one element).
15+
- `protocol` (String): The first protocol or `"file"`.
16+
- `port` (String): The domain port (default: `""`).
17+
- `resource` (String): The url domain (including subdomain and port).
18+
- `user` (String): The authentication user (default: `""`).
19+
- `password` (String): The authentication password (default: `""`).
20+
- `pathname` (String): The url pathname.
21+
- `hash` (String): The url hash.
22+
- `search` (String): The url querystring value (excluding `?`).
23+
- `href` (String): The normalized input url.
24+
- `query` (Object): The url querystring, parsed as object.
2425

README.md

+51-50
Original file line numberDiff line numberDiff line change
@@ -78,48 +78,49 @@ yarn add parse-path
7878
const parsePath = require("parse-path")
7979

8080
console.log(parsePath("http://ionicabizau.net/blog"))
81-
// { protocols: [ 'http' ],
81+
// {
82+
// protocols: [ 'http' ],
8283
// protocol: 'http',
83-
// port: null,
84+
// port: '',
8485
// resource: 'ionicabizau.net',
8586
// user: '',
87+
// password: '',
8688
// pathname: '/blog',
8789
// hash: '',
8890
// search: '',
89-
// href: 'http://ionicabizau.net/blog' }
91+
// href: 'http://ionicabizau.net/blog',
92+
// query: {}
93+
// }
9094

9195
console.log(parsePath("http://domain.com/path/name?foo=bar&bar=42#some-hash"))
92-
// { protocols: [ 'http' ],
96+
// {
97+
// protocols: [ 'http' ],
9398
// protocol: 'http',
94-
// port: null,
99+
// port: '',
95100
// resource: 'domain.com',
96101
// user: '',
102+
// password: '',
97103
// pathname: '/path/name',
98104
// hash: 'some-hash',
99105
// search: 'foo=bar&bar=42',
100-
// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' }
106+
// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash',
107+
// query: { foo: 'bar', bar: '42' }
108+
// }
101109

102110
console.log(parsePath("git+ssh://[email protected]/path/name.git"))
103-
// { protocols: [ 'git', 'ssh' ],
111+
// {
112+
// protocols: [ 'git', 'ssh' ],
104113
// protocol: 'git',
105-
// port: null,
114+
// port: '',
106115
// resource: 'host.xz',
107116
// user: 'git',
117+
// password: '',
108118
// pathname: '/path/name.git',
109119
// hash: '',
110120
// search: '',
111-
// href: 'git+ssh://[email protected]/path/name.git' }
112-
113-
console.log(parsePath("[email protected]:IonicaBizau/git-stats.git"))
114-
// { protocols: [],
115-
// protocol: 'ssh',
116-
// port: null,
117-
// resource: 'github.com',
118-
// user: 'git',
119-
// pathname: '/IonicaBizau/git-stats.git',
120-
// hash: '',
121-
// search: '',
122-
// href: '[email protected]:IonicaBizau/git-stats.git' }
121+
// href: 'git+ssh://[email protected]/path/name.git',
122+
// query: {}
123+
// }
123124
```
124125

125126

@@ -158,16 +159,17 @@ Parses the input url.
158159

159160
#### Return
160161
- **Object** An object containing the following fields:
161-
- `protocols` (Array): An array with the url protocols (usually it has one element).
162-
- `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`.
163-
- `port` (null|Number): The domain port.
164-
- `resource` (String): The url domain (including subdomains).
165-
- `user` (String): The authentication user (usually for ssh urls).
166-
- `pathname` (String): The url pathname.
167-
- `hash` (String): The url hash.
168-
- `search` (String): The url querystring value.
169-
- `href` (String): The input url.
170-
- `query` (Object): The url querystring, parsed as object.
162+
- `protocols` (Array): An array with the url protocols (usually it has one element).
163+
- `protocol` (String): The first protocol or `"file"`.
164+
- `port` (String): The domain port (default: `""`).
165+
- `resource` (String): The url domain (including subdomain and port).
166+
- `user` (String): The authentication user (default: `""`).
167+
- `password` (String): The authentication password (default: `""`).
168+
- `pathname` (String): The url pathname.
169+
- `hash` (String): The url hash.
170+
- `search` (String): The url querystring value (excluding `?`).
171+
- `href` (String): The normalized input url.
172+
- `query` (Object): The url querystring, parsed as object.
171173

172174

173175

@@ -228,39 +230,36 @@ If you are using this library in one of your projects, add it in this list. :spa
228230
- `eleventy-plugin-embed-soundcloud`
229231
- `@enkeledi/react-native-week-month-date-picker`
230232
- `@hemith/react-native-tnk`
231-
- `npm_one_1_2_3`
232233
- `native-kakao-login`
233-
- `rn-adyen-dropin`
234+
- `npm_one_1_2_3`
234235
- `react-fsm-router`
235-
- `react-native-contact-list`
236-
- `react-native-biometric-authenticate`
237236
- `react-native-arunmeena1987`
237+
- `react-native-biometric-authenticate`
238+
- `react-native-contact-list`
238239
- `react-native-is7`
240+
- `react-native-payu-payment-testing`
239241
- `react-native-kakao-maps`
240242
- `react-native-my-first-try-arun-ramya`
241-
- `react-native-payu-payment-testing`
242243
- `react-native-ytximkit`
244+
- `rn-adyen-dropin`
243245
- `tria-prima`
244246
- `sm-versioning`
247+
- `@positionex/position-sdk`
245248
- `@corelmax/react-native-my2c2p-sdk`
246-
- `@datalogic/react-native-datalogic-module`
247249
- `@felipesimmi/react-native-datalogic-module`
248250
- `@hawkingnetwork/react-native-tab-view`
249251
- `drowl-base-theme-iconset`
250252
- `native-apple-login`
251253
- `react-native-cplus`
252254
- `npm_qwerty`
253-
- `react-native-arunjeyam1987`
254255
- `react-native-bubble-chart`
256+
- `react-native-arunjeyam1987`
255257
- `react-native-flyy`
256-
- `@alphy11/semantic-release-gitlab`
257-
- `@apardellass/react-native-audio-stream`
258-
- `@fgreinacher/semantic-release-gitlab`
259-
- `@geeky-apo/react-native-advanced-clipboard`
260-
- `@j4s0n/semantic-release-gitlab`
261258
- `@saad27/react-native-bottom-tab-tour`
262259
- `@xudong/semantic-release-gitlab`
263260
- `candlelabssdk`
261+
- `@fgreinacher/semantic-release-gitlab`
262+
- `@geeky-apo/react-native-advanced-clipboard`
264263
- `react-native-dsphoto-module`
265264
- `react-native-responsive-size`
266265
- `react-native-sayhello-module`
@@ -271,21 +270,22 @@ If you are using this library in one of your projects, add it in this list. :spa
271270
- `payutesting`
272271
- `semantic-release-gitee`
273272
- `semantic-release-gitlab-plugin`
274-
- `@pvm/github`
275273
- `@pvm/plugin-conventional-changelog`
276-
- `@devdiary/semantic-devdiary-release`
277-
- `birken-react-native-community-image-editor`
278-
- `luojia-cli-dev`
274+
- `@pvm/github`
275+
- `@con-test/react-native-concent-common`
279276
- `reac-native-arun-ramya-test`
280-
- `react-native-plugpag-wrapper`
281-
- `react-native-pulsator-native`
282277
- `react-native-arun-ramya-test`
283278
- `react-native-arunramya151`
279+
- `react-native-plugpag-wrapper`
280+
- `react-native-pulsator-native`
284281
- `react-native-transtracker-library`
285282
- `semantic-release-version`
283+
- `@devdiary/semantic-devdiary-release`
284+
- `luojia-cli-dev`
285+
- `birken-react-native-community-image-editor`
286286
- `@screeb/react-native`
287-
- `@cloudoki/donderflow`
288287
- `@buganto/client`
288+
- `@cloudoki/donderflow`
289289
- `@tjoussen/semantic-release-gitlab-mr`
290290
- `astra-ufo-sdk`
291291
- `react-native-syan-photo-picker`
@@ -294,11 +294,12 @@ If you are using this library in one of your projects, add it in this list. :spa
294294
- `l2forlerna`
295295
- `native-google-login`
296296
- `raact-native-arunramya151`
297+
- `react-native-modal-progress-bar`
297298
- `react-native-test-module-hhh`
298299
- `reddit-title-has-verbatim-quote`
300+
- `react-native-jsi-device-info`
299301
- `react-native-badge-control`
300302
- `rn-tm-notify`
301-
- `react-native-jsi-device-info`
302303

303304

304305

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const protocols = require("protocols")
1111
*
1212
* - `protocols` (Array): An array with the url protocols (usually it has one element).
1313
* - `protocol` (String): The first protocol or `"file"`.
14-
* - `port` (null|Number): The domain port.
14+
* - `port` (String): The domain port (default: `""`).
1515
* - `resource` (String): The url domain (including subdomain and port).
1616
* - `user` (String): The authentication user (default: `""`).
1717
* - `password` (String): The authentication password (default: `""`).

test/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ const INPUTS = [
1919
, query: {}
2020
}
2121
]
22+
, [
23+
"http://subdomain.ionicabizau.net/blog"
24+
, {
25+
protocols: [ "http" ]
26+
, protocol: "http"
27+
, port: ""
28+
, resource: "subdomain.ionicabizau.net"
29+
, user: ""
30+
, pathname: "/blog"
31+
, hash: ""
32+
, search: ""
33+
, href: "http://subdomain.ionicabizau.net/blog"
34+
, query: {}
35+
}
36+
]
2237
, [
2338
" http://ionicabizau.net/blog "
2439
, {

0 commit comments

Comments
 (0)