{"version":3,"file":"jsonCodec.cjs","names":["loadExternalFile"],"sources":["../../src/jsonCodec.ts"],"sourcesContent":["import { loadExternalFile } from '@intlayer/config/file';\nimport type { FormatCodec, SyncContent } from '@intlayer/engine/syncPluginKit';\n\n/**\n * JSON payload codec: standard JSON parsing, pretty-printed serialization\n * (2-space indentation, trailing newline).\n */\nexport const jsonCodec: FormatCodec = {\n  parse: (raw) => JSON.parse(raw),\n  serialize: (content) => `${JSON.stringify(content, null, 2)}\\n`,\n};\n\n/**\n * Read one JSON source through `loadExternalFile`, which also supports JSON5,\n * JSONC and transpiled JS/TS message files. Returns `undefined` for missing or\n * unreadable files so callers fall back to empty content.\n */\nexport const readJSONEntry = async (\n  absoluteFilePath: string\n): Promise<SyncContent | undefined> =>\n  await loadExternalFile(absoluteFilePath, { logError: false });\n"],"mappings":";;;;;;;;AAOA,MAAa,YAAyB;CACpC,QAAQ,QAAQ,KAAK,MAAM,GAAG;CAC9B,YAAY,YAAY,GAAG,KAAK,UAAU,SAAS,MAAM,CAAC,EAAE;AAC9D;;;;;;AAOA,MAAa,gBAAgB,OAC3B,qBAEA,UAAMA,wCAAiB,kBAAkB,EAAE,UAAU,MAAM,CAAC"}