import type { ExpectationResult, KeyedExpectations } from "./types";

import { checkKeyedExpectations } from "./keyed";

export function checkHeaderExpectations(
  headers: Record<string, unknown>,
  expectations?: KeyedExpectations,
): ExpectationResult {
  return checkKeyedExpectations(headers, expectations, {
    normalizeKey: (key) => key.toLowerCase(),
    path: "headers",
    phase: "headers",
  });
}
