File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -135,13 +135,17 @@ For example: `'#hash'`
135135added: v0.1.25
136136-->
137137
138- * ` urlObject ` {Object} A URL object (either as returned by ` url.parse() ` or
139- constructed otherwise).
138+ * ` urlObject ` {Object | String} A URL object (as returned by ` url.parse() ` or
139+ constructed otherwise). If a string, it is converted to an object by passing
140+ it to ` url.parse() ` .
140141
141- The ` url.format() ` method processes the given URL object and returns a formatted
142- URL string .
142+ The ` url.format() ` method returns a formatted URL string derived from
143+ ` urlObject ` .
143144
144- The formatting process essentially operates as follows:
145+ If ` urlObject ` is not an object or a string, ` url.parse() ` will throw a
146+ [ ` TypeError ` ] [ ] .
147+
148+ The formatting process operates as follows:
145149
146150* A new empty string ` result ` is created.
147151* If ` urlObject.protocol ` is a string, it is appended as-is to ` result ` .
@@ -247,3 +251,4 @@ forward slash (`/`) character is encoded as `%3C`.
247251
248252[ `Error` ] : errors.html#errors_class_error
249253[ `querystring` ] : querystring.html
254+ [ `TypeError` ] : errors.html#errors_class_typeerror
You can’t perform that action at this time.
0 commit comments