import { createPlugin } from "seroval";
const ShallowErrorPlugin = /* @__PURE__ */ createPlugin({
  tag: "$TSR/Error",
  test(value) {
    return value instanceof Error;
  },
  parse: {
    sync(value, ctx) {
      return {
        message: ctx.parse(value.message)
      };
    },
    async async(value, ctx) {
      return {
        message: await ctx.parse(value.message)
      };
    },
    stream(value, ctx) {
      return {
        message: ctx.parse(value.message)
      };
    }
  },
  serialize(node, ctx) {
    return "new Error(" + ctx.serialize(node.message) + ")";
  },
  deserialize(node, ctx) {
    return new Error(ctx.deserialize(node.message));
  }
});
export {
  ShallowErrorPlugin
};//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/def9583aef9852ff94cb0dea16ede9bb6b095b30/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/ShallowErrorPlugin.js.map
