From f2815732244615f26623e789173293b264a47246 Mon Sep 17 00:00:00 2001 From: Steve <_steve_@outlook.com> Date: Sat, 27 Sep 2014 10:48:55 +0200 Subject: [PATCH] node.d.ts support object type for Url.query --- node/node-tests.ts | 8 ++++++++ node/node.d.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index e9ef58dbb..a8475a8dc 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -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 }); diff --git a/node/node.d.ts b/node/node.d.ts index 4140a8c4b..7893f6fc6 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -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;