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 <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
RaisinTen authored and Trott committed Jan 24, 2021
1 parent 6b62f70 commit 85e6089
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 85e6089

Please sign in to comment.