diff --git a/packages/http/src/base_request_options.ts b/packages/http/src/base_request_options.ts index 76e873c25bb4b..32fb201f26c5e 100644 --- a/packages/http/src/base_request_options.ts +++ b/packages/http/src/base_request_options.ts @@ -79,9 +79,8 @@ export class RequestOptions { responseType: ResponseContentType|null; // TODO(Dzmitry): remove search when this.search is removed - constructor( - {method, headers, body, url, search, params, withCredentials, - responseType}: RequestOptionsArgs = {}) { + constructor(opts: RequestOptionsArgs = {}) { + const {method, headers, body, url, search, params, withCredentials, responseType} = opts; this.method = method != null ? normalizeMethodName(method) : null; this.headers = headers != null ? headers : null; this.body = body != null ? body : null; diff --git a/packages/http/src/base_response_options.ts b/packages/http/src/base_response_options.ts index 1e62aea15c490..8417dac70ddbb 100644 --- a/packages/http/src/base_response_options.ts +++ b/packages/http/src/base_response_options.ts @@ -65,7 +65,8 @@ export class ResponseOptions { */ type: ResponseType|null; url: string|null; - constructor({body, status, headers, statusText, type, url}: ResponseOptionsArgs = {}) { + constructor(opts: ResponseOptionsArgs = {}) { + const {body, status, headers, statusText, type, url} = opts; this.body = body != null ? body : null; this.status = status != null ? status : null; this.headers = headers != null ? headers : null; diff --git a/tools/public_api_guard/http/http.d.ts b/tools/public_api_guard/http/http.d.ts index e1bd37fd8f30a..d1c17073b1e4a 100644 --- a/tools/public_api_guard/http/http.d.ts +++ b/tools/public_api_guard/http/http.d.ts @@ -144,7 +144,7 @@ export declare class RequestOptions { /** @deprecated */ search: URLSearchParams; url: string | null; withCredentials: boolean | null; - constructor({method, headers, body, url, search, params, withCredentials, responseType}?: RequestOptionsArgs); + constructor(opts?: RequestOptionsArgs); merge(options?: RequestOptionsArgs): RequestOptions; } @@ -192,7 +192,7 @@ export declare class ResponseOptions { headers: Headers | null; status: number | null; url: string | null; - constructor({body, status, headers, statusText, type, url}?: ResponseOptionsArgs); + constructor(opts?: ResponseOptionsArgs); merge(options?: ResponseOptionsArgs): ResponseOptions; }