function indexLifecycleConfiguration(config) {
  config.allowConfig = config.allowConfig || {}
  // packages with config
  const configuredPatterns = Object.keys(config.allowConfig)
  // select allowed + disallowed
  config.allowedPatterns = Object.entries(config.allowConfig)
    .filter(([, packageData]) => !!packageData)
    .map(([pattern]) => pattern)

  config.disallowedPatterns = Object.entries(config.allowConfig)
    .filter(([, packageData]) => !packageData)
    .map(([pattern]) => pattern)

  config.missingPolicies = Array.from(
    config.packagesWithScripts.keys() ?? []
  ).filter((pattern) => !configuredPatterns.includes(pattern))

  config.excessPolicies = configuredPatterns.filter(
    (pattern) => !config.packagesWithScripts.has(pattern)
  )

  return /** @type {ScriptsConfig} */ (config)
}
Adds helpful redundancy to the config object thus producing a full
ScriptsConfig type

@param {import('type-fest').SetRequired<
  Partial<ScriptsConfig>,
  'packagesWithScripts'
>} config
@returns {ScriptsConfig}