{"version":3,"file":"json.cjs","names":[],"sources":["../../../src/utils/json.ts"],"sourcesContent":["/**\n * Safely stringify data that may contain BigInt values\n * BigInt values are converted to objects with a special marker\n */\nexport function stringifyWithBigInt(data: any): string {\n  return JSON.stringify(data, (_key, value) => {\n    if (typeof value === 'bigint') {\n      return {\n        __type: 'bigint',\n        value: value.toString(),\n      }\n    }\n    return value\n  })\n}\n\n/**\n * Parse JSON and restore BigInt values\n * Objects with __type: 'bigint' are converted back to BigInt\n */\nexport function parseWithBigInt(json: string): any {\n  return JSON.parse(json, (_key, value) => {\n    if (\n      value &&\n      typeof value === 'object' &&\n      value.__type === 'bigint' &&\n      typeof value.value === 'string'\n    ) {\n      return BigInt(value.value)\n    }\n    return value\n  })\n}\n"],"mappings":";;;;;AAIA,SAAgB,oBAAoB,MAAmB;CACrD,OAAO,KAAK,UAAU,OAAO,MAAM,UAAU;EAC3C,IAAI,OAAO,UAAU,UACnB,OAAO;GACL,QAAQ;GACR,OAAO,MAAM,UAAU;GACxB;EAEH,OAAO;GACP;;;;;;AAOJ,SAAgB,gBAAgB,MAAmB;CACjD,OAAO,KAAK,MAAM,OAAO,MAAM,UAAU;EACvC,IACE,SACA,OAAO,UAAU,YACjB,MAAM,WAAW,YACjB,OAAO,MAAM,UAAU,UAEvB,OAAO,OAAO,MAAM,MAAM;EAE5B,OAAO;GACP"}