fix(url-parse): Add optional stringify fn to toString

This commit is contained in:
Offir Golan
2019-02-05 09:38:15 -08:00
committed by GitHub
parent 9259b6ab73
commit 7cfcc63349
+4 -2
View File
@@ -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;
};
};