function loadPoliciesSync({ debugMode, policyPath, policyOverridePath }) {
  const policy = readPolicyFileSync({ debugMode, policyPath })
  const policyOverride = readPolicyFileSync({
    debugMode,
    policyPath: policyOverridePath,
  })

  return {
    policy,
    applyOverride: (main) => {
      if (!policyOverride) {
        return main
      }
      if (debugMode) {
        console.warn('Merging policy-override.json into policy.json')
      }
      return mergePolicy(main, policyOverride)
    },
  }
}
Loads policy and policy overrides from disk and merges them.

Doesn't write anything back to disk.

@param {PolicyOpts & { policyOverridePath: string }} opts
@returns {{
  policy: import('./schema').LavaMoatPolicy | undefined
  applyOverride: (
    main: import('./schema').LavaMoatPolicy
  ) => import('./schema').LavaMoatPolicy
}}