import{a as m,b as i,g as a,h as r}from"./chunk-IFUYCFBO.mjs";import{a as e}from"./chunk-3PFH3U2T.mjs";import"./chunk-76CZ6Z7T.mjs";m("serialize",()=>{let t={foo:"bar",num:42};i("serializes JSON",async()=>{let o=await e("json",t);a(o).toContain('"foo": "bar"'),a(o).toContain('"num": 42'),a(()=>JSON.parse(o)).not.toThrow()}),i("serializes JSON5 (same as JSON)",async()=>{let o=await e("json5",t);a(o).toContain('"foo": "bar"'),a(o).toContain('"num": 42')}),i("serializes YAML",async()=>{r.doMock("yaml",()=>({stringify:n=>`mock-yaml: ${JSON.stringify(n)}`}));let{serialize:o}=await import("./file-serializer.mjs"),s=await o("yaml",t);a(s).toContain("mock-yaml")}),i("serializes TOML",async()=>{r.doMock("smol-toml",()=>({stringify:n=>`mock-toml = ${JSON.stringify(n)}`}));let{serialize:o}=await import("./file-serializer.mjs"),s=await o("toml",t);a(s).toContain("mock-toml")}),i("serializes XML",async()=>{r.doMock("fast-xml-parser",()=>({XMLBuilder:class{build(n){return`<mock>${JSON.stringify(n)}</mock>`}}}));let{serialize:o}=await import("./file-serializer.mjs"),s=await o("xml",t);a(s).toContain("<mock>")}),i("throws for unknown format",async()=>{await a(e("unknown",t)).rejects.toThrow(/Unknown format/)})});
