Skip to content

Commit 9e5ebde

Browse files
committed
refactor(grpc_proto): js default simplification
1 parent b462be6 commit 9e5ebde

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

packages/grpc_proto/dist/cjs/index.cjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ var index = {
1313
return path.resolve(__dirname$1, "./shell.proto");
1414
},
1515
load: function (proto) {
16-
if (proto == null) {
17-
proto = this.resolve();
18-
}
16+
proto ??= this.resolve();
1917
return protoLoader.load(proto, {
2018
keepCase: true,
2119
longs: String,
@@ -25,9 +23,7 @@ var index = {
2523
});
2624
},
2725
loadSync: function (proto) {
28-
if (proto == null) {
29-
proto = this.resolve();
30-
}
26+
proto ??= this.resolve();
3127
return protoLoader.loadSync(proto, {
3228
keepCase: true,
3329
longs: String,

packages/grpc_proto/dist/esm/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ var index = {
1010
return path.resolve(__dirname, "./shell.proto");
1111
},
1212
load: function (proto) {
13-
if (proto == null) {
14-
proto = this.resolve();
15-
}
13+
proto ??= this.resolve();
1614
return protoLoader.load(proto, {
1715
keepCase: true,
1816
longs: String,
@@ -22,9 +20,7 @@ var index = {
2220
});
2321
},
2422
loadSync: function (proto) {
25-
if (proto == null) {
26-
proto = this.resolve();
27-
}
23+
proto ??= this.resolve();
2824
return protoLoader.loadSync(proto, {
2925
keepCase: true,
3026
longs: String,

packages/grpc_proto/lib/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ export default {
99
return path.resolve(__dirname, "./shell.proto");
1010
},
1111
load: function (proto) {
12-
if (proto == null) {
13-
proto = this.resolve();
14-
}
12+
proto ??= this.resolve();
1513
return protoLoader.load(proto, {
1614
keepCase: true,
1715
longs: String,
@@ -21,9 +19,7 @@ export default {
2119
});
2220
},
2321
loadSync: function (proto) {
24-
if (proto == null) {
25-
proto = this.resolve();
26-
}
22+
proto ??= this.resolve();
2723
return protoLoader.loadSync(proto, {
2824
keepCase: true,
2925
longs: String,

0 commit comments

Comments
 (0)