Skip to content

Commit e9e798f

Browse files
authored
replace logical or operators with nullish coalescing operator (#1253)
1 parent 4f32b86 commit e9e798f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class Client {
5454
} else {
5555
this.config = new Config();
5656
}
57-
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix || '';
57+
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix ?? '';
5858

59-
const environment = options.environment || this.config.environment;
59+
const environment = options.environment ?? this.config.environment;
6060
if (environment) {
6161
this.setEnvironment(environment, options.liveEndpointUrlPrefix);
6262
if (options.username && options.password) {
@@ -80,7 +80,7 @@ class Client {
8080
public setEnvironment(environment: Environment, liveEndpointUrlPrefix?: string): void {
8181
// ensure environment and liveUrlPrefix is set in config
8282
this.config.environment = environment;
83-
this.liveEndpointUrlPrefix = liveEndpointUrlPrefix || "";
83+
this.liveEndpointUrlPrefix = liveEndpointUrlPrefix ?? "";
8484

8585
if (environment === "TEST") {
8686
this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_TEST;

0 commit comments

Comments
 (0)