Skip to content

Commit

Permalink
refactor(http): use nullish coalescing operator in HttpRequest.clone()
Browse files Browse the repository at this point in the history
Refactor how boolean options are handled in HttpRequest.clone() method by using nullish coalescing operator
  • Loading branch information
mlz11 committed Mar 19, 2024
1 parent 5e12f1d commit 8a90bb8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/common/http/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,8 @@ export class HttpRequest<T> {

// Carefully handle the boolean options to differentiate between
// `false` and `undefined` in the update args.
const withCredentials =
update.withCredentials !== undefined ? update.withCredentials : this.withCredentials;
const reportProgress =
update.reportProgress !== undefined ? update.reportProgress : this.reportProgress;
const withCredentials = update.withCredentials ?? this.withCredentials;
const reportProgress = update.reportProgress ?? this.reportProgress;

// Headers and params may be appended to if `setHeaders` or
// `setParams` are used.
Expand Down

0 comments on commit 8a90bb8

Please sign in to comment.