Skip to content

Commit

Permalink
Update package for build verification
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman committed Apr 20, 2022
1 parent c6c5ce4 commit 61defb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/abstractions/src/requestInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ export class RequestInformation {
return this._requestOptions;
}
/** Adds the headers for the request. */
public addHeaders(source: Record<string, string>) {
public addRequestHeaders(source: Record<string, string> | undefined) {
if (!source) return;
for (const key in source) {
this.headers[key] = source[key];
}
}
/** Adds the request options for the request. */
public addRequestOptions(...options: RequestOption[]) {
public addRequestOptions(options: RequestOption[] | undefined) {
if (!options || options.length === 0) return;
options.forEach((option) => {
this._requestOptions[option.getKey()] = option;
Expand Down Expand Up @@ -137,7 +137,10 @@ export class RequestInformation {
* Sets the query string parameters from a raw object.
* @param parameters the parameters.
*/
public setQueryStringParametersFromRawObject = (q: object): void => {
public setQueryStringParametersFromRawObject = (
q: object | undefined
): void => {
if (!q) return;
Object.entries(q).forEach(([k, v]) => {
let key = k;
if ((q as any).getQueryParameter) {
Expand Down
2 changes: 1 addition & 1 deletion packages/abstractions/test/common/requestInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("RequestInformation", () => {
requestInformation.pathParameters["baseurl"] = baseUrl;
requestInformation.urlTemplate = "http://localhost/me{?%24select}";
const headers: Record<string, string> = { ConsistencyLevel: "eventual" };
requestInformation.addHeaders(headers);
requestInformation.addRequestHeaders(headers);
assert.isNotEmpty(requestInformation.headers);
assert.equal("eventual", requestInformation.headers["ConsistencyLevel"]);
});
Expand Down

0 comments on commit 61defb5

Please sign in to comment.