import {
  tryCatch
} from "./chunk-3AL4EMTU.mjs";
import {
  identity
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Json.ts
var Json_exports = {};
__export(Json_exports, {
  parse: () => parse,
  stringify: () => stringify
});
var parse = (s) => tryCatch(() => JSON.parse(s), identity);
var stringify = (a) => tryCatch(() => {
  const s = JSON.stringify(a);
  if (typeof s !== "string") {
    throw new Error("Converting unsupported structure to JSON");
  }
  return s;
}, identity);

export {
  parse,
  stringify,
  Json_exports
};
