From 23df99dceef7659f8798ddcf46f5fa9dc87fdf0c Mon Sep 17 00:00:00 2001 From: davidgoli Date: Fri, 4 Jan 2019 10:23:21 -0800 Subject: [PATCH] reorder signatures; implement constructor signature --- types/url-parse/index.d.ts | 3 ++- types/url-parse/url-parse-tests.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/url-parse/index.d.ts b/types/url-parse/index.d.ts index 4d33354e9e..8fc22dbfc0 100644 --- a/types/url-parse/index.d.ts +++ b/types/url-parse/index.d.ts @@ -44,9 +44,10 @@ interface URLParse { } declare const URLParse: { + new(address: string, parser?: boolean | URLParse.QueryParser): URLParse; new(address: string, location?: string | object, parser?: boolean | URLParse.QueryParser): URLParse; - (address: string, location?: string | object, parser?: boolean | URLParse.QueryParser): URLParse; (address: string, parser?: boolean | URLParse.QueryParser): URLParse; + (address: string, location?: string | object, parser?: boolean | URLParse.QueryParser): URLParse; extractProtocol(url: string): { slashes: boolean; diff --git a/types/url-parse/url-parse-tests.ts b/types/url-parse/url-parse-tests.ts index be8b8afe8c..b25603763c 100644 --- a/types/url-parse/url-parse-tests.ts +++ b/types/url-parse/url-parse-tests.ts @@ -3,6 +3,7 @@ const parse = URL; new URL('foo/bar', 'https://github.com/'); new URL('foo/bar', 'https://github.com/', (query: string) => ({ query })); +new URL('foo/bar', 'https://github.com/', true); parse('foo/bar', 'https://github.com/'); parse('foo/bar', 'https://github.com/', (query: string) => ({ query })); const result = parse('foo/bar?baz=quux', true);