diff options
author | Yazhong Liu <yorkiefixer@gmail.com> | 2014-11-20 23:46:38 +0800 |
---|---|---|
committer | Chris Dickinson <christopher.s.dickinson@gmail.com> | 2014-12-02 11:32:08 -0800 |
commit | ba687f6eb431ce7fd5e324ef495d2e133a3f254b (patch) | |
tree | df7825a7e63e59aeeccf811877a1509f06910027 /doc | |
parent | d24b7b85006dc3dd8e07dc6d4a0c630329833456 (diff) | |
download | node-new-ba687f6eb431ce7fd5e324ef495d2e133a3f254b.tar.gz |
url: support `path` for url.format
this adds support for a "path" field that overrides
"query", "search", and "pathname" if given.
Fixes: https://github.com/joyent/node/issues/8722
PR-URL: https://github.com/joyent/node/pull/8755
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/url.markdown | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/api/url.markdown b/doc/api/url.markdown index 6b8ff9d507..3ace699579 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -95,11 +95,12 @@ Take a parsed URL object, and return a formatted URL string. * `hostname` will only be used if `host` is absent. * `port` will only be used if `host` is absent. * `host` will be used in place of `hostname` and `port` -* `pathname` is treated the same with or without the leading `/` (slash) -* `search` will be used in place of `query` +* `pathname` is treated the same with or without the leading `/` (slash). +* `path` is treated the same with `pathname` but able to contain `query` as well. +* `search` will be used in place of `query`. * `query` (object; see `querystring`) will only be used if `search` is absent. -* `search` is treated the same with or without the leading `?` (question mark) -* `hash` is treated the same with or without the leading `#` (pound sign, anchor) +* `search` is treated the same with or without the leading `?` (question mark). +* `hash` is treated the same with or without the leading `#` (pound sign, anchor). ## url.resolve(from, to) |