mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2884 from stkb/node-url
node.d.ts Support object type for Url.query
This commit is contained in:
@@ -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 });
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user