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 authored and Michaël Zasso committed 2021-02-02 10:41:57 +01:00
1 parent de6dca12e8
commit 4a1fc42178
1 file changed
+1 -5
+1 -5
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() {