Skip to content

Commit 61defb5

Browse files
author
Andrew Omondi
committed
Update package for build verification
1 parent c6c5ce4 commit 61defb5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/abstractions/src/requestInformation.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ export class RequestInformation {
7070
return this._requestOptions;
7171
}
7272
/** Adds the headers for the request. */
73-
public addHeaders(source: Record<string, string>) {
73+
public addRequestHeaders(source: Record<string, string> | undefined) {
7474
if (!source) return;
7575
for (const key in source) {
7676
this.headers[key] = source[key];
7777
}
7878
}
7979
/** Adds the request options for the request. */
80-
public addRequestOptions(...options: RequestOption[]) {
80+
public addRequestOptions(options: RequestOption[] | undefined) {
8181
if (!options || options.length === 0) return;
8282
options.forEach((option) => {
8383
this._requestOptions[option.getKey()] = option;
@@ -137,7 +137,10 @@ export class RequestInformation {
137137
* Sets the query string parameters from a raw object.
138138
* @param parameters the parameters.
139139
*/
140-
public setQueryStringParametersFromRawObject = (q: object): void => {
140+
public setQueryStringParametersFromRawObject = (
141+
q: object | undefined
142+
): void => {
143+
if (!q) return;
141144
Object.entries(q).forEach(([k, v]) => {
142145
let key = k;
143146
if ((q as any).getQueryParameter) {

packages/abstractions/test/common/requestInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("RequestInformation", () => {
5959
requestInformation.pathParameters["baseurl"] = baseUrl;
6060
requestInformation.urlTemplate = "http://localhost/me{?%24select}";
6161
const headers: Record<string, string> = { ConsistencyLevel: "eventual" };
62-
requestInformation.addHeaders(headers);
62+
requestInformation.addRequestHeaders(headers);
6363
assert.isNotEmpty(requestInformation.headers);
6464
assert.equal("eventual", requestInformation.headers["ConsistencyLevel"]);
6565
});

0 commit comments

Comments
 (0)