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 Feb 2, 2021
1 parent de6dca1 commit 4a1fc42
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 4a1fc42

Please sign in to comment.