diff --git a/lib/internal/options.js b/lib/internal/options.js index 68acdb2a7b378e..1192b46c9ede82 100644 --- a/lib/internal/options.js +++ b/lib/internal/options.js @@ -17,24 +17,15 @@ let embedderOptions; // complete so that we don't accidentally include runtime-dependent // states into a runtime-independent snapshot. function getCLIOptionsFromBinding() { - if (!optionsDict) { - optionsDict = getCLIOptionsValues(); - } - return optionsDict; + return optionsDict ??= getCLIOptionsValues(); } function getCLIOptionsInfoFromBinding() { - if (!cliInfo) { - cliInfo = getCLIOptionsInfo(); - } - return cliInfo; + return cliInfo ??= getCLIOptionsInfo(); } function getEmbedderOptions() { - if (!embedderOptions) { - embedderOptions = getEmbedderOptionsFromBinding(); - } - return embedderOptions; + return embedderOptions ??= getEmbedderOptionsFromBinding(); } function refreshOptions() { @@ -42,8 +33,7 @@ function refreshOptions() { } function getOptionValue(optionName) { - const optionsDict = getCLIOptionsFromBinding(); - return optionsDict[optionName]; + return getCLIOptionsFromBinding()[optionName]; } function getAllowUnauthorized() {