Skip to content

Commit 47ed512

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 836fba5 commit 47ed512

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎lib/internal/options.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ const { options, aliases } = getOptions();
66
letwarnOnAllowUnauthorized=true;
77

88
functiongetOptionValue(option){
9-
constresult=options.get(option);
10-
if(!result){
11-
returnundefined;
12-
}
13-
returnresult.value;
9+
returnoptions.get(option)?.value;
1410
}
1511

1612
functiongetAllowUnauthorized(){

0 commit comments

Comments
 (0)