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
#54939)

Refactor how boolean options are handled in HttpRequest.clone() method by using nullish coalescing operator

PR Close #54939
  • Loading branch information
mlz11 authored and dylhunn committed Mar 22, 2024
1 parent cb433af commit 1f7e81a
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 1f7e81a

Please sign in to comment.