mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user