mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-08 19:40:13 -05:00
15 lines
310 B
TypeScript
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,
|
|
});
|
|
}
|