convertToEndoPackagePolicy = (resources) => {
  if (!resources) {
    return
  }
  const pkgPolicy = create(null)
  if (resources.packages) {
    pkgPolicy[ENDO_PKG_POLICY_PACKAGES] = convertToEndoPackagePolicyPackages(
      resources.packages
    )
  }
  if (resources.globals) {
    pkgPolicy[ENDO_PKG_POLICY_GLOBALS] = convertToEndoPackagePolicyGlobals(
      resources.globals
    )
  }
  if (resources.builtin) {
    pkgPolicy[ENDO_PKG_POLICY_BUILTINS] = convertToEndoPackagePolicyBuiltins(
      resources.builtin
    )
  }
  const pkgPolicyOptions = convertToEndoPackagePolicyOptions(resources)
  if (pkgPolicyOptions) {
    pkgPolicy[ENDO_PKG_POLICY_OPTIONS] = pkgPolicyOptions
  }
  return pkgPolicy
}
Converts a {@link ResourcePolicy} object to a {@link LavaMoatEndoPackagePolicy}
object

@param {ResourcePolicy} [resources] Mapping of resource names to policy
  values (if any)
@returns {LavaMoatEndoPackagePolicy | undefined}