snapshot of https://github.com/mountain-loop/yaak.git (main, 2026-09-23; blobs > 131072B omitted)
This commit is contained in:
14
apps/yaak-client/lib/diffYaml.ts
Normal file
14
apps/yaak-client/lib/diffYaml.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user