Merge pull request #2884 from stkb/node-url

node.d.ts Support object type for Url.query
This commit is contained in:
Basarat Ali Syed
2014-09-29 18:36:19 +10:00
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -59,6 +59,10 @@ class Networker extends events.EventEmitter {
}
}
////////////////////////////////////////////////////
/// Url tests : http://nodejs.org/api/url.html
////////////////////////////////////////////////////
url.format(url.parse('http://www.example.com/xyz'));
// https://google.com/search?q=you're%20a%20lizard%2C%20gary
@@ -69,6 +73,10 @@ url.format({
query: { q: "you're a lizard, gary" }
});
var helloUrl = url.parse('http://example.com/?hello=world', true)
assert.equal(helloUrl.query.hello, 'world');
// Old and new util.inspect APIs
util.inspect(["This is nice"], false, 5);
util.inspect(["This is nice"], { colors: true, depth: 5, customInspect: false });
+1 -1
View File
@@ -658,7 +658,7 @@ declare module "url" {
host: string;
pathname: string;
search: string;
query: string;
query: any; // string | Object
slashes: boolean;
hash?: string;
path?: string;