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 targos committed Jun 5, 2021
1 parent de6b446 commit 4dc12f5
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 4dc12f5

Please sign in to comment.