lib: refactor to use optional chaining in internal/options.js

PR-URL: https://github.com/nodejs/node/pull/36939
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
raisinten 2021-01-15 15:16:42 +05:30 committed by Rich Trott
parent 6b62f706a4
commit 85e6089c4d
1 changed files with 1 additions and 5 deletions

View File

@ -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() {