Skip to content

Commit

Permalink
lib: refactor to use optional chaining in internal/options.js
Browse files Browse the repository at this point in the history
PR-URL: #36939
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
RaisinTen authored and targos committed Jun 11, 2021
1 parent 836fba5 commit 47ed512
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/internal/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ const { options, aliases } = getOptions();
let warnOnAllowUnauthorized = true;

function getOptionValue(option) {
const result = options.get(option);
if (!result) {
return undefined;
}
return result.value;
return options.get(option)?.value;
}

function getAllowUnauthorized() {
Expand Down

0 comments on commit 47ed512

Please sign in to comment.