Skip to content

Commit

Permalink
replace logical or operators with nullish coalescing operator (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
wboereboom committed Sep 22, 2023
1 parent 4f32b86 commit e9e798f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class Client {
} else {
this.config = new Config();
}
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix || '';
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix ?? '';

const environment = options.environment || this.config.environment;
const environment = options.environment ?? this.config.environment;
if (environment) {
this.setEnvironment(environment, options.liveEndpointUrlPrefix);
if (options.username && options.password) {
Expand All @@ -80,7 +80,7 @@ class Client {
public setEnvironment(environment: Environment, liveEndpointUrlPrefix?: string): void {
// ensure environment and liveUrlPrefix is set in config
this.config.environment = environment;
this.liveEndpointUrlPrefix = liveEndpointUrlPrefix || "";
this.liveEndpointUrlPrefix = liveEndpointUrlPrefix ?? "";

if (environment === "TEST") {
this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_TEST;
Expand Down

0 comments on commit e9e798f

Please sign in to comment.