Files
yaak/apps/yaak-client/lib/diffYaml.ts
2026-05-08 11:25:39 -07:00

15 lines
310 B
TypeScript

import type { SyncModel } from "@yaakapp-internal/git";
import { stringify } from "yaml";
/**
* Convert a SyncModel to a YAML string for diffing.
*/
export function modelToYaml(model: SyncModel | null): string {
if (!model) return "";
return stringify(model, {
indent: 2,
lineWidth: 0,
});
}