src/main/options-normalizer.js/normalizeOptions
function normalizeOptions(
  options,
  optionInfos,
  {
    logger = false,
    isCLI = false,
    passThrough = false,
    colorsModule = null,
    levenshteinDistance = null,
  } = {}
) {
  const unknown = !passThrough
    ? (key, value, options) => {
        // Don't suggest `_` for unknown flags
        const { _, ...schemas } = options.schemas;
        return vnopts.levenUnknownHandler(key, value, {
          ...options,
          schemas,
        });
      }
    : Array.isArray(passThrough)
    ? (key, value) =>
        !passThrough.includes(key) ? undefined : { [key]: value }
    : (key, value) => ({ [key]: value });

  const descriptor = isCLI ? cliDescriptor : vnopts.apiDescriptor;
  const schemas = optionInfosToSchemas(optionInfos, {
    isCLI,
    colorsModule,
    levenshteinDistance,
  });
  const normalizer = new vnopts.Normalizer(schemas, {
    logger,
    unknown,
    descriptor,
  });

  const shouldSuppressDuplicateDeprecationWarnings = logger !== false;

  if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
    // @ts-expect-error
    normalizer._hasDeprecationWarned = hasDeprecationWarned;
  }

  const normalized = normalizer.normalize(options);

  if (shouldSuppressDuplicateDeprecationWarnings) {
    // @ts-expect-error
    hasDeprecationWarned = normalizer._hasDeprecationWarned;
  }

  if (isCLI && normalized["plugin-search"] === false) {
    normalized["plugin-search-dir"] = false;
  }

  return normalized;
}