From 7cfcc63349263b36d1dba5a64a7039b5e646145b Mon Sep 17 00:00:00 2001 From: Offir Golan Date: Tue, 5 Feb 2019 09:38:15 -0800 Subject: [PATCH 1/2] fix(url-parse): Add optional stringify fn to `toString` --- types/url-parse/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/url-parse/index.d.ts b/types/url-parse/index.d.ts index 8fc22dbfc0..e9dbd83208 100644 --- a/types/url-parse/index.d.ts +++ b/types/url-parse/index.d.ts @@ -23,6 +23,8 @@ declare namespace URLParse { | 'username'; type QueryParser = (query: string) => object; + + type StringifyQuery = (query: object) => string; } interface URLParse { @@ -40,7 +42,7 @@ interface URLParse { readonly slashes: boolean; readonly username: string; set(part: URLParse.URLPart, value: string | object | number | undefined, fn?: boolean | URLParse.QueryParser): URLParse; - toString(): string; + toString(stringify?: URLParse.StringifyQuery): string; } declare const URLParse: { @@ -57,7 +59,7 @@ declare const URLParse: { location(url: string): object; qs: { parse: URLParse.QueryParser; - stringify(query: object): string; + stringify: URLParse.StringifyQuery; }; }; From f68b114c80675cbec1c6de875c77e6dd0681ccdf Mon Sep 17 00:00:00 2001 From: Offir Golan Date: Tue, 5 Feb 2019 09:56:48 -0800 Subject: [PATCH 2/2] chore: Remove trailing whitespace --- types/url-parse/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/url-parse/index.d.ts b/types/url-parse/index.d.ts index e9dbd83208..cb3bc75dd5 100644 --- a/types/url-parse/index.d.ts +++ b/types/url-parse/index.d.ts @@ -23,7 +23,7 @@ declare namespace URLParse { | 'username'; type QueryParser = (query: string) => object; - + type StringifyQuery = (query: object) => string; }