/*
RFC-0364: YAML normalizer using yaml package — parse and re-serialize in stable form.
- Do not introduce app-specific runtime composition or deployment behavior into this reusable package source file.
- RFC-0364: initial YAML normalizer.
*/
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
import { byteHash } from "@warpgogol/werkstatt-shared/fingerprint";
export function normalizeYaml(content: string): string {
const parsed = parseYaml(content);
const reSerialized = stringifyYaml(parsed, { sortMapEntries: true });
return byteHash(reSerialized);
}