@tanstack/query-devtools 5.14.5 → 5.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2032,7 +2032,7 @@ function Dynamic(props) {
2032
2032
  });
2033
2033
  }
2034
2034
 
2035
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/double-indexed-kv.js
2035
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/double-indexed-kv.js
2036
2036
  var DoubleIndexedKV = (
2037
2037
  /** @class */
2038
2038
  function() {
@@ -2058,7 +2058,7 @@ var DoubleIndexedKV = (
2058
2058
  }()
2059
2059
  );
2060
2060
 
2061
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/registry.js
2061
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/registry.js
2062
2062
  var Registry = (
2063
2063
  /** @class */
2064
2064
  function() {
@@ -2088,7 +2088,7 @@ var Registry = (
2088
2088
  }()
2089
2089
  );
2090
2090
 
2091
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/class-registry.js
2091
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/class-registry.js
2092
2092
  var __extends = function() {
2093
2093
  var extendStatics = function(d, b) {
2094
2094
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
@@ -2138,7 +2138,7 @@ var ClassRegistry = (
2138
2138
  }(Registry)
2139
2139
  );
2140
2140
 
2141
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/util.js
2141
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/util.js
2142
2142
  var __read = function(o, n) {
2143
2143
  var m = typeof Symbol === "function" && o[Symbol.iterator];
2144
2144
  if (!m)
@@ -2205,7 +2205,7 @@ function findArr(record, predicate) {
2205
2205
  return void 0;
2206
2206
  }
2207
2207
 
2208
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/custom-transformer-registry.js
2208
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/custom-transformer-registry.js
2209
2209
  var CustomTransformerRegistry = (
2210
2210
  /** @class */
2211
2211
  function() {
@@ -2227,7 +2227,7 @@ var CustomTransformerRegistry = (
2227
2227
  }()
2228
2228
  );
2229
2229
 
2230
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/is.js
2230
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/is.js
2231
2231
  var getType = function(payload) {
2232
2232
  return Object.prototype.toString.call(payload).slice(8, -1);
2233
2233
  };
@@ -2298,7 +2298,7 @@ var isURL = function(payload) {
2298
2298
  return payload instanceof URL;
2299
2299
  };
2300
2300
 
2301
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/pathstringifier.js
2301
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/pathstringifier.js
2302
2302
  var escapeKey = function(key) {
2303
2303
  return key.replace(/\./g, "\\.");
2304
2304
  };
@@ -2329,7 +2329,7 @@ var parsePath = function(string) {
2329
2329
  return result;
2330
2330
  };
2331
2331
 
2332
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/transformer.js
2332
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/transformer.js
2333
2333
  var __assign = function() {
2334
2334
  __assign = Object.assign || function(t) {
2335
2335
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -2602,7 +2602,7 @@ var untransformValue = function(json, type, superJson) {
2602
2602
  }
2603
2603
  };
2604
2604
 
2605
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/accessDeep.js
2605
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/accessDeep.js
2606
2606
  var getNthKey = function(value, n) {
2607
2607
  var keys = value.keys();
2608
2608
  while (n > 0) {
@@ -2716,7 +2716,7 @@ var setDeep = function(object, path, mapper) {
2716
2716
  return object;
2717
2717
  };
2718
2718
 
2719
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/plainer.js
2719
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/plainer.js
2720
2720
  var __read3 = function(o, n) {
2721
2721
  var m = typeof Symbol === "function" && o[Symbol.iterator];
2722
2722
  if (!m)
@@ -2807,22 +2807,25 @@ function addIdentity(object, path, identities) {
2807
2807
  identities.set(object, [path]);
2808
2808
  }
2809
2809
  }
2810
- function generateReferentialEqualityAnnotations(identitites) {
2810
+ function generateReferentialEqualityAnnotations(identitites, dedupe) {
2811
2811
  var result = {};
2812
2812
  var rootEqualityPaths = void 0;
2813
2813
  identitites.forEach(function(paths) {
2814
2814
  if (paths.length <= 1) {
2815
2815
  return;
2816
2816
  }
2817
- var _a = __read3(paths.map(function(path) {
2818
- return path.map(String);
2819
- }).sort(function(a, b) {
2820
- return a.length - b.length;
2821
- })), shortestPath = _a[0], identicalPaths = _a.slice(1);
2822
- if (shortestPath.length === 0) {
2817
+ if (!dedupe) {
2818
+ paths = paths.map(function(path) {
2819
+ return path.map(String);
2820
+ }).sort(function(a, b) {
2821
+ return a.length - b.length;
2822
+ });
2823
+ }
2824
+ var _a = __read3(paths), representativePath = _a[0], identicalPaths = _a.slice(1);
2825
+ if (representativePath.length === 0) {
2823
2826
  rootEqualityPaths = identicalPaths.map(stringifyPath);
2824
2827
  } else {
2825
- result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);
2828
+ result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
2826
2829
  }
2827
2830
  });
2828
2831
  if (rootEqualityPaths) {
@@ -2835,7 +2838,7 @@ function generateReferentialEqualityAnnotations(identitites) {
2835
2838
  return isEmptyObject(result) ? void 0 : result;
2836
2839
  }
2837
2840
  }
2838
- var walker = function(object, identities, superJson, path, objectsInThisPath) {
2841
+ var walker = function(object, identities, superJson, dedupe, path, objectsInThisPath, seenObjects) {
2839
2842
  var _a;
2840
2843
  if (path === void 0) {
2841
2844
  path = [];
@@ -2843,21 +2846,31 @@ var walker = function(object, identities, superJson, path, objectsInThisPath) {
2843
2846
  if (objectsInThisPath === void 0) {
2844
2847
  objectsInThisPath = [];
2845
2848
  }
2846
- if (!isPrimitive(object)) {
2849
+ if (seenObjects === void 0) {
2850
+ seenObjects = /* @__PURE__ */ new Map();
2851
+ }
2852
+ var primitive = isPrimitive(object);
2853
+ if (!primitive) {
2847
2854
  addIdentity(object, path, identities);
2855
+ var seen = seenObjects.get(object);
2856
+ if (seen) {
2857
+ return dedupe ? {
2858
+ transformedValue: null
2859
+ } : seen;
2860
+ }
2848
2861
  }
2849
2862
  if (!isDeep(object, superJson)) {
2850
2863
  var transformed_1 = transformValue(object, superJson);
2851
- if (transformed_1) {
2852
- return {
2853
- transformedValue: transformed_1.value,
2854
- annotations: [transformed_1.type]
2855
- };
2856
- } else {
2857
- return {
2858
- transformedValue: object
2859
- };
2864
+ var result_1 = transformed_1 ? {
2865
+ transformedValue: transformed_1.value,
2866
+ annotations: [transformed_1.type]
2867
+ } : {
2868
+ transformedValue: object
2869
+ };
2870
+ if (!primitive) {
2871
+ seenObjects.set(object, result_1);
2860
2872
  }
2873
+ return result_1;
2861
2874
  }
2862
2875
  if (includes(objectsInThisPath, object)) {
2863
2876
  return {
@@ -2866,13 +2879,10 @@ var walker = function(object, identities, superJson, path, objectsInThisPath) {
2866
2879
  }
2867
2880
  var transformationResult = transformValue(object, superJson);
2868
2881
  var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;
2869
- if (!isPrimitive(object)) {
2870
- objectsInThisPath = __spreadArray2(__spreadArray2([], __read3(objectsInThisPath)), [object]);
2871
- }
2872
2882
  var transformedValue = isArray(transformed) ? [] : {};
2873
2883
  var innerAnnotations = {};
2874
2884
  forEach(transformed, function(value, index) {
2875
- var recursiveResult = walker(value, identities, superJson, __spreadArray2(__spreadArray2([], __read3(path)), [index]), objectsInThisPath);
2885
+ var recursiveResult = walker(value, identities, superJson, dedupe, __spreadArray2(__spreadArray2([], __read3(path)), [index]), __spreadArray2(__spreadArray2([], __read3(objectsInThisPath)), [object]), seenObjects);
2876
2886
  transformedValue[index] = recursiveResult.transformedValue;
2877
2887
  if (isArray(recursiveResult.annotations)) {
2878
2888
  innerAnnotations[index] = recursiveResult.annotations;
@@ -2882,17 +2892,17 @@ var walker = function(object, identities, superJson, path, objectsInThisPath) {
2882
2892
  });
2883
2893
  }
2884
2894
  });
2885
- if (isEmptyObject(innerAnnotations)) {
2886
- return {
2887
- transformedValue,
2888
- annotations: !!transformationResult ? [transformationResult.type] : void 0
2889
- };
2890
- } else {
2891
- return {
2892
- transformedValue,
2893
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
2894
- };
2895
+ var result = isEmptyObject(innerAnnotations) ? {
2896
+ transformedValue,
2897
+ annotations: !!transformationResult ? [transformationResult.type] : void 0
2898
+ } : {
2899
+ transformedValue,
2900
+ annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
2901
+ };
2902
+ if (!primitive) {
2903
+ seenObjects.set(object, result);
2895
2904
  }
2905
+ return result;
2896
2906
  };
2897
2907
 
2898
2908
  // ../../node_modules/.pnpm/is-what@4.1.15/node_modules/is-what/dist/index.js
@@ -2953,7 +2963,7 @@ function copy(target, options = {}) {
2953
2963
  }, {});
2954
2964
  }
2955
2965
 
2956
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/index.js
2966
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/index.js
2957
2967
  var __assign2 = function() {
2958
2968
  __assign2 = Object.assign || function(t) {
2959
2969
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -2995,25 +3005,27 @@ var __spreadArray3 = function(to, from) {
2995
3005
  var SuperJSON = (
2996
3006
  /** @class */
2997
3007
  function() {
2998
- function SuperJSON2() {
3008
+ function SuperJSON2(_a) {
3009
+ var _b = _a === void 0 ? {} : _a, _c = _b.dedupe, dedupe = _c === void 0 ? false : _c;
2999
3010
  this.classRegistry = new ClassRegistry();
3000
3011
  this.symbolRegistry = new Registry(function(s) {
3001
- var _a;
3002
- return (_a = s.description) !== null && _a !== void 0 ? _a : "";
3012
+ var _a2;
3013
+ return (_a2 = s.description) !== null && _a2 !== void 0 ? _a2 : "";
3003
3014
  });
3004
3015
  this.customTransformerRegistry = new CustomTransformerRegistry();
3005
3016
  this.allowedErrorProps = [];
3017
+ this.dedupe = dedupe;
3006
3018
  }
3007
3019
  SuperJSON2.prototype.serialize = function(object) {
3008
3020
  var identities = /* @__PURE__ */ new Map();
3009
- var output = walker(object, identities, this);
3021
+ var output = walker(object, identities, this, this.dedupe);
3010
3022
  var res = {
3011
3023
  json: output.transformedValue
3012
3024
  };
3013
3025
  if (output.annotations) {
3014
3026
  res.meta = __assign2(__assign2({}, res.meta), { values: output.annotations });
3015
3027
  }
3016
- var equalityAnnotations = generateReferentialEqualityAnnotations(identities);
3028
+ var equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
3017
3029
  if (equalityAnnotations) {
3018
3030
  res.meta = __assign2(__assign2({}, res.meta), { referentialEqualities: equalityAnnotations });
3019
3031
  }
@@ -2030,7 +2030,7 @@ function Dynamic(props) {
2030
2030
  });
2031
2031
  }
2032
2032
 
2033
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/double-indexed-kv.js
2033
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/double-indexed-kv.js
2034
2034
  var DoubleIndexedKV = (
2035
2035
  /** @class */
2036
2036
  function() {
@@ -2056,7 +2056,7 @@ var DoubleIndexedKV = (
2056
2056
  }()
2057
2057
  );
2058
2058
 
2059
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/registry.js
2059
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/registry.js
2060
2060
  var Registry = (
2061
2061
  /** @class */
2062
2062
  function() {
@@ -2086,7 +2086,7 @@ var Registry = (
2086
2086
  }()
2087
2087
  );
2088
2088
 
2089
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/class-registry.js
2089
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/class-registry.js
2090
2090
  var __extends = function() {
2091
2091
  var extendStatics = function(d, b) {
2092
2092
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
@@ -2136,7 +2136,7 @@ var ClassRegistry = (
2136
2136
  }(Registry)
2137
2137
  );
2138
2138
 
2139
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/util.js
2139
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/util.js
2140
2140
  var __read = function(o, n) {
2141
2141
  var m = typeof Symbol === "function" && o[Symbol.iterator];
2142
2142
  if (!m)
@@ -2203,7 +2203,7 @@ function findArr(record, predicate) {
2203
2203
  return void 0;
2204
2204
  }
2205
2205
 
2206
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/custom-transformer-registry.js
2206
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/custom-transformer-registry.js
2207
2207
  var CustomTransformerRegistry = (
2208
2208
  /** @class */
2209
2209
  function() {
@@ -2225,7 +2225,7 @@ var CustomTransformerRegistry = (
2225
2225
  }()
2226
2226
  );
2227
2227
 
2228
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/is.js
2228
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/is.js
2229
2229
  var getType = function(payload) {
2230
2230
  return Object.prototype.toString.call(payload).slice(8, -1);
2231
2231
  };
@@ -2296,7 +2296,7 @@ var isURL = function(payload) {
2296
2296
  return payload instanceof URL;
2297
2297
  };
2298
2298
 
2299
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/pathstringifier.js
2299
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/pathstringifier.js
2300
2300
  var escapeKey = function(key) {
2301
2301
  return key.replace(/\./g, "\\.");
2302
2302
  };
@@ -2327,7 +2327,7 @@ var parsePath = function(string) {
2327
2327
  return result;
2328
2328
  };
2329
2329
 
2330
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/transformer.js
2330
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/transformer.js
2331
2331
  var __assign = function() {
2332
2332
  __assign = Object.assign || function(t) {
2333
2333
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -2600,7 +2600,7 @@ var untransformValue = function(json, type, superJson) {
2600
2600
  }
2601
2601
  };
2602
2602
 
2603
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/accessDeep.js
2603
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/accessDeep.js
2604
2604
  var getNthKey = function(value, n) {
2605
2605
  var keys = value.keys();
2606
2606
  while (n > 0) {
@@ -2714,7 +2714,7 @@ var setDeep = function(object, path, mapper) {
2714
2714
  return object;
2715
2715
  };
2716
2716
 
2717
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/plainer.js
2717
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/plainer.js
2718
2718
  var __read3 = function(o, n) {
2719
2719
  var m = typeof Symbol === "function" && o[Symbol.iterator];
2720
2720
  if (!m)
@@ -2805,22 +2805,25 @@ function addIdentity(object, path, identities) {
2805
2805
  identities.set(object, [path]);
2806
2806
  }
2807
2807
  }
2808
- function generateReferentialEqualityAnnotations(identitites) {
2808
+ function generateReferentialEqualityAnnotations(identitites, dedupe) {
2809
2809
  var result = {};
2810
2810
  var rootEqualityPaths = void 0;
2811
2811
  identitites.forEach(function(paths) {
2812
2812
  if (paths.length <= 1) {
2813
2813
  return;
2814
2814
  }
2815
- var _a = __read3(paths.map(function(path) {
2816
- return path.map(String);
2817
- }).sort(function(a, b) {
2818
- return a.length - b.length;
2819
- })), shortestPath = _a[0], identicalPaths = _a.slice(1);
2820
- if (shortestPath.length === 0) {
2815
+ if (!dedupe) {
2816
+ paths = paths.map(function(path) {
2817
+ return path.map(String);
2818
+ }).sort(function(a, b) {
2819
+ return a.length - b.length;
2820
+ });
2821
+ }
2822
+ var _a = __read3(paths), representativePath = _a[0], identicalPaths = _a.slice(1);
2823
+ if (representativePath.length === 0) {
2821
2824
  rootEqualityPaths = identicalPaths.map(stringifyPath);
2822
2825
  } else {
2823
- result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);
2826
+ result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
2824
2827
  }
2825
2828
  });
2826
2829
  if (rootEqualityPaths) {
@@ -2833,7 +2836,7 @@ function generateReferentialEqualityAnnotations(identitites) {
2833
2836
  return isEmptyObject(result) ? void 0 : result;
2834
2837
  }
2835
2838
  }
2836
- var walker = function(object, identities, superJson, path, objectsInThisPath) {
2839
+ var walker = function(object, identities, superJson, dedupe, path, objectsInThisPath, seenObjects) {
2837
2840
  var _a;
2838
2841
  if (path === void 0) {
2839
2842
  path = [];
@@ -2841,21 +2844,31 @@ var walker = function(object, identities, superJson, path, objectsInThisPath) {
2841
2844
  if (objectsInThisPath === void 0) {
2842
2845
  objectsInThisPath = [];
2843
2846
  }
2844
- if (!isPrimitive(object)) {
2847
+ if (seenObjects === void 0) {
2848
+ seenObjects = /* @__PURE__ */ new Map();
2849
+ }
2850
+ var primitive = isPrimitive(object);
2851
+ if (!primitive) {
2845
2852
  addIdentity(object, path, identities);
2853
+ var seen = seenObjects.get(object);
2854
+ if (seen) {
2855
+ return dedupe ? {
2856
+ transformedValue: null
2857
+ } : seen;
2858
+ }
2846
2859
  }
2847
2860
  if (!isDeep(object, superJson)) {
2848
2861
  var transformed_1 = transformValue(object, superJson);
2849
- if (transformed_1) {
2850
- return {
2851
- transformedValue: transformed_1.value,
2852
- annotations: [transformed_1.type]
2853
- };
2854
- } else {
2855
- return {
2856
- transformedValue: object
2857
- };
2862
+ var result_1 = transformed_1 ? {
2863
+ transformedValue: transformed_1.value,
2864
+ annotations: [transformed_1.type]
2865
+ } : {
2866
+ transformedValue: object
2867
+ };
2868
+ if (!primitive) {
2869
+ seenObjects.set(object, result_1);
2858
2870
  }
2871
+ return result_1;
2859
2872
  }
2860
2873
  if (includes(objectsInThisPath, object)) {
2861
2874
  return {
@@ -2864,13 +2877,10 @@ var walker = function(object, identities, superJson, path, objectsInThisPath) {
2864
2877
  }
2865
2878
  var transformationResult = transformValue(object, superJson);
2866
2879
  var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;
2867
- if (!isPrimitive(object)) {
2868
- objectsInThisPath = __spreadArray2(__spreadArray2([], __read3(objectsInThisPath)), [object]);
2869
- }
2870
2880
  var transformedValue = isArray(transformed) ? [] : {};
2871
2881
  var innerAnnotations = {};
2872
2882
  forEach(transformed, function(value, index) {
2873
- var recursiveResult = walker(value, identities, superJson, __spreadArray2(__spreadArray2([], __read3(path)), [index]), objectsInThisPath);
2883
+ var recursiveResult = walker(value, identities, superJson, dedupe, __spreadArray2(__spreadArray2([], __read3(path)), [index]), __spreadArray2(__spreadArray2([], __read3(objectsInThisPath)), [object]), seenObjects);
2874
2884
  transformedValue[index] = recursiveResult.transformedValue;
2875
2885
  if (isArray(recursiveResult.annotations)) {
2876
2886
  innerAnnotations[index] = recursiveResult.annotations;
@@ -2880,17 +2890,17 @@ var walker = function(object, identities, superJson, path, objectsInThisPath) {
2880
2890
  });
2881
2891
  }
2882
2892
  });
2883
- if (isEmptyObject(innerAnnotations)) {
2884
- return {
2885
- transformedValue,
2886
- annotations: !!transformationResult ? [transformationResult.type] : void 0
2887
- };
2888
- } else {
2889
- return {
2890
- transformedValue,
2891
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
2892
- };
2893
+ var result = isEmptyObject(innerAnnotations) ? {
2894
+ transformedValue,
2895
+ annotations: !!transformationResult ? [transformationResult.type] : void 0
2896
+ } : {
2897
+ transformedValue,
2898
+ annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
2899
+ };
2900
+ if (!primitive) {
2901
+ seenObjects.set(object, result);
2893
2902
  }
2903
+ return result;
2894
2904
  };
2895
2905
 
2896
2906
  // ../../node_modules/.pnpm/is-what@4.1.15/node_modules/is-what/dist/index.js
@@ -2941,7 +2951,7 @@ function copy(target, options = {}) {
2941
2951
  }, {});
2942
2952
  }
2943
2953
 
2944
- // ../../node_modules/.pnpm/superjson@1.12.4/node_modules/superjson/dist/esm/index.js
2954
+ // ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/index.js
2945
2955
  var __assign2 = function() {
2946
2956
  __assign2 = Object.assign || function(t) {
2947
2957
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -2983,25 +2993,27 @@ var __spreadArray3 = function(to, from) {
2983
2993
  var SuperJSON = (
2984
2994
  /** @class */
2985
2995
  function() {
2986
- function SuperJSON2() {
2996
+ function SuperJSON2(_a) {
2997
+ var _b = _a === void 0 ? {} : _a, _c = _b.dedupe, dedupe = _c === void 0 ? false : _c;
2987
2998
  this.classRegistry = new ClassRegistry();
2988
2999
  this.symbolRegistry = new Registry(function(s) {
2989
- var _a;
2990
- return (_a = s.description) !== null && _a !== void 0 ? _a : "";
3000
+ var _a2;
3001
+ return (_a2 = s.description) !== null && _a2 !== void 0 ? _a2 : "";
2991
3002
  });
2992
3003
  this.customTransformerRegistry = new CustomTransformerRegistry();
2993
3004
  this.allowedErrorProps = [];
3005
+ this.dedupe = dedupe;
2994
3006
  }
2995
3007
  SuperJSON2.prototype.serialize = function(object) {
2996
3008
  var identities = /* @__PURE__ */ new Map();
2997
- var output = walker(object, identities, this);
3009
+ var output = walker(object, identities, this, this.dedupe);
2998
3010
  var res = {
2999
3011
  json: output.transformedValue
3000
3012
  };
3001
3013
  if (output.annotations) {
3002
3014
  res.meta = __assign2(__assign2({}, res.meta), { values: output.annotations });
3003
3015
  }
3004
- var equalityAnnotations = generateReferentialEqualityAnnotations(identities);
3016
+ var equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
3005
3017
  if (equalityAnnotations) {
3006
3018
  res.meta = __assign2(__assign2({}, res.meta), { referentialEqualities: equalityAnnotations });
3007
3019
  }