@frui.ts/apiclient
Advanced tools
Comparing version 0.16.2 to 0.16.3
@@ -34,4 +34,4 @@ import { IApiConnector } from "./types"; | ||
withBaseUrl(url: string): this; | ||
getQueryString(query: any): string; | ||
appendQuery(url: string, query?: any): string; | ||
getQueryString(query: any, queryStringOptions?: StringifyOptions): string; | ||
appendQuery(url: string, query?: any, queryStringOptions?: StringifyOptions): string; | ||
} |
@@ -115,8 +115,12 @@ "use strict"; | ||
}; | ||
RestRequestBuilder.prototype.getQueryString = function (query) { | ||
RestRequestBuilder.prototype.getQueryString = function (query, queryStringOptions) { | ||
var _a; | ||
return query_string_1.stringify(query, (_a = this.queryStringOptions) !== null && _a !== void 0 ? _a : RestRequestBuilder.DefaultQueryStringOptions); | ||
return query_string_1.stringify(query, (_a = queryStringOptions !== null && queryStringOptions !== void 0 ? queryStringOptions : this.queryStringOptions) !== null && _a !== void 0 ? _a : RestRequestBuilder.DefaultQueryStringOptions); | ||
}; | ||
RestRequestBuilder.prototype.appendQuery = function (url, query) { | ||
return query ? url + "?" + this.getQueryString(query) : url; | ||
RestRequestBuilder.prototype.appendQuery = function (url, query, queryStringOptions) { | ||
if (!query) { | ||
return url; | ||
} | ||
var queryString = typeof query === "string" ? query : this.getQueryString(query, queryStringOptions); | ||
return url + "?" + queryString; | ||
}; | ||
@@ -123,0 +127,0 @@ RestRequestBuilder.DefaultQueryStringOptions = { skipNull: true }; |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.16.2", | ||
"version": "0.16.3", | ||
"description": "Frui.ts helpers for HTTP communication", | ||
@@ -36,6 +36,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@frui.ts/helpers": "^0.16.2", | ||
"@frui.ts/helpers": "^0.16.3", | ||
"query-string": "^6.9.0" | ||
}, | ||
"gitHead": "4e9a698e964a13779157b1fe4a2dbb52cd7a64af" | ||
"gitHead": "fc58a17e18bea299f6aeb6f1090569443eccaafc" | ||
} |
Sorry, the diff of this file is not supported yet
38889
369
Updated@frui.ts/helpers@^0.16.3