node.d.ts support object type for Url.query

This commit is contained in:
Steve
2014-09-27 10:51:03 +02:00
committed by Steve Baker
parent fe50484fda
commit f281573224
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 });