Skip to content

Commit 4a1fc42

Browse files
RaisinTentargos
authored andcommitted
lib: refactor to use optional chaining in internal/options.js
PR-URL: #36939 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent de6dca1 commit 4a1fc42

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/internal/options.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ const { options, aliases } = getOptions();
66
let warnOnAllowUnauthorized = true;
77

88
function getOptionValue(option) {
9-
const result = options.get(option);
10-
if (!result) {
11-
return undefined;
12-
}
13-
return result.value;
9+
return options.get(option)?.value;
1410
}
1511

1612
function getAllowUnauthorized() {

0 commit comments

Comments
 (0)