mirror of https://github.com/nodejs/node.git
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:
parent
6b62f706a4
commit
85e6089c4d
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue