@camstack/addon-benchmark 0.1.14 → 0.1.16
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.
- package/dist/{__mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-CCBTZBOa.mjs → __mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-h5aXOPSA.mjs} +1 -1
- package/dist/__mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-BDmWQEu5.mjs +16 -0
- package/dist/{__mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.mjs-D0mCkXl6.mjs → __mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.mjs-DrODo4jp.mjs} +8 -8
- package/dist/{__mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.mjs_commonjs-proxy-Y5C1IdnH.mjs → __mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.mjs_commonjs-proxy-JW-pexXa.mjs} +1 -1
- package/dist/{__mfe_internal__addon_benchmark_page__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DHyNsEqy.mjs → __mfe_internal__addon_benchmark_page__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-B7BvuptH.mjs} +1 -1
- package/dist/_stub.js +8101 -3922
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-Cc3NF30a.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-BUKd6AUn.mjs} +10 -11
- package/dist/addon-benchmark.css +1 -1
- package/dist/{client-CcDLM_13.mjs → client-DFXd_CTL.mjs} +2 -2
- package/dist/{hostInit-CAVqKr6S.mjs → hostInit-DRs7W4Ua.mjs} +12 -12
- package/dist/{index-DaSo_2kE.mjs → index-B3DDm3f_.mjs} +1 -1
- package/dist/index-BBYroIy-.mjs +1617 -0
- package/dist/{index-DnFVXz0U.mjs → index-BY_6d_z0.mjs} +12396 -11333
- package/dist/{index-Dh5vmX_b.mjs → index-CwX5nq5R.mjs} +1 -1
- package/dist/{index-BJiPhUp0.mjs → index-DIVnrURN.mjs} +1 -1
- package/dist/{index-DDFHp1Wk.mjs → index-DqipDAUg.mjs} +1 -1
- package/dist/index-UC6WY72C.mjs +19109 -0
- package/dist/{jsx-runtime-Dnzp-FK_.mjs → jsx-runtime-BblBcpPM.mjs} +1 -1
- package/dist/remoteEntry.js +2933 -45
- package/package.json +6 -2
- package/dist/__mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-DqxRPOgh.mjs +0 -16
- package/dist/index-BumDn7Si.mjs +0 -3402
- package/dist/index-C3iAUQqS.mjs +0 -533
- package/dist/index-CMtMiC4k.mjs +0 -2464
- package/dist/index-CWhCtlI6.mjs +0 -14567
- package/dist/index-D0dNM7_R.mjs +0 -2892
package/dist/index-C3iAUQqS.mjs
DELETED
|
@@ -1,533 +0,0 @@
|
|
|
1
|
-
class ee {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
|
|
4
|
-
}
|
|
5
|
-
set(t, r) {
|
|
6
|
-
this.keyToValue.set(t, r), this.valueToKey.set(r, t);
|
|
7
|
-
}
|
|
8
|
-
getByKey(t) {
|
|
9
|
-
return this.keyToValue.get(t);
|
|
10
|
-
}
|
|
11
|
-
getByValue(t) {
|
|
12
|
-
return this.valueToKey.get(t);
|
|
13
|
-
}
|
|
14
|
-
clear() {
|
|
15
|
-
this.keyToValue.clear(), this.valueToKey.clear();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
class K {
|
|
19
|
-
constructor(t) {
|
|
20
|
-
this.generateIdentifier = t, this.kv = new ee();
|
|
21
|
-
}
|
|
22
|
-
register(t, r) {
|
|
23
|
-
this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
|
|
24
|
-
}
|
|
25
|
-
clear() {
|
|
26
|
-
this.kv.clear();
|
|
27
|
-
}
|
|
28
|
-
getIdentifier(t) {
|
|
29
|
-
return this.kv.getByValue(t);
|
|
30
|
-
}
|
|
31
|
-
getValue(t) {
|
|
32
|
-
return this.kv.getByKey(t);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
class te extends K {
|
|
36
|
-
constructor() {
|
|
37
|
-
super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
38
|
-
}
|
|
39
|
-
register(t, r) {
|
|
40
|
-
typeof r == "object" ? (r.allowProps && this.classToAllowedProps.set(t, r.allowProps), super.register(t, r.identifier)) : super.register(t, r);
|
|
41
|
-
}
|
|
42
|
-
getAllowedProps(t) {
|
|
43
|
-
return this.classToAllowedProps.get(t);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function re(e) {
|
|
47
|
-
if ("values" in Object)
|
|
48
|
-
return Object.values(e);
|
|
49
|
-
const t = [];
|
|
50
|
-
for (const r in e)
|
|
51
|
-
e.hasOwnProperty(r) && t.push(e[r]);
|
|
52
|
-
return t;
|
|
53
|
-
}
|
|
54
|
-
function ne(e, t) {
|
|
55
|
-
const r = re(e);
|
|
56
|
-
if ("find" in r)
|
|
57
|
-
return r.find(t);
|
|
58
|
-
const n = r;
|
|
59
|
-
for (let s = 0; s < n.length; s++) {
|
|
60
|
-
const i = n[s];
|
|
61
|
-
if (t(i))
|
|
62
|
-
return i;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function h(e, t) {
|
|
66
|
-
Object.entries(e).forEach(([r, n]) => t(n, r));
|
|
67
|
-
}
|
|
68
|
-
function A(e, t) {
|
|
69
|
-
return e.indexOf(t) !== -1;
|
|
70
|
-
}
|
|
71
|
-
function z(e, t) {
|
|
72
|
-
for (let r = 0; r < e.length; r++) {
|
|
73
|
-
const n = e[r];
|
|
74
|
-
if (t(n))
|
|
75
|
-
return n;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
class se {
|
|
79
|
-
constructor() {
|
|
80
|
-
this.transfomers = {};
|
|
81
|
-
}
|
|
82
|
-
register(t) {
|
|
83
|
-
this.transfomers[t.name] = t;
|
|
84
|
-
}
|
|
85
|
-
findApplicable(t) {
|
|
86
|
-
return ne(this.transfomers, (r) => r.isApplicable(t));
|
|
87
|
-
}
|
|
88
|
-
findByName(t) {
|
|
89
|
-
return this.transfomers[t];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const ie = (e) => Object.prototype.toString.call(e).slice(8, -1), U = (e) => typeof e > "u", oe = (e) => e === null, R = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, T = (e) => R(e) && Object.keys(e).length === 0, m = (e) => Array.isArray(e), ae = (e) => typeof e == "string", le = (e) => typeof e == "number" && !isNaN(e), ce = (e) => typeof e == "boolean", ue = (e) => e instanceof RegExp, I = (e) => e instanceof Map, O = (e) => e instanceof Set, M = (e) => ie(e) === "Symbol", fe = (e) => e instanceof Date && !isNaN(e.valueOf()), q = (e) => e instanceof Error, B = (e) => typeof e == "number" && isNaN(e), ye = (e) => ce(e) || oe(e) || U(e) || le(e) || ae(e) || M(e), me = (e) => typeof e == "bigint", ge = (e) => e === 1 / 0 || e === -1 / 0, de = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), pe = (e) => e instanceof URL, S = (e) => e.replace(/\\/g, "\\\\").replace(/\./g, "\\."), k = (e) => e.map(String).map(S).join("."), E = (e, t) => {
|
|
93
|
-
const r = [];
|
|
94
|
-
let n = "";
|
|
95
|
-
for (let i = 0; i < e.length; i++) {
|
|
96
|
-
let o = e.charAt(i);
|
|
97
|
-
if (!t && o === "\\") {
|
|
98
|
-
const g = e.charAt(i + 1);
|
|
99
|
-
if (g === "\\") {
|
|
100
|
-
n += "\\", i++;
|
|
101
|
-
continue;
|
|
102
|
-
} else if (g !== ".")
|
|
103
|
-
throw Error("invalid path");
|
|
104
|
-
}
|
|
105
|
-
if (o === "\\" && e.charAt(i + 1) === ".") {
|
|
106
|
-
n += ".", i++;
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
if (o === ".") {
|
|
110
|
-
r.push(n), n = "";
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
n += o;
|
|
114
|
-
}
|
|
115
|
-
const s = n;
|
|
116
|
-
return r.push(s), r;
|
|
117
|
-
};
|
|
118
|
-
function f(e, t, r, n) {
|
|
119
|
-
return {
|
|
120
|
-
isApplicable: e,
|
|
121
|
-
annotation: t,
|
|
122
|
-
transform: r,
|
|
123
|
-
untransform: n
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
const x = [
|
|
127
|
-
f(U, "undefined", () => null, () => {
|
|
128
|
-
}),
|
|
129
|
-
f(me, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
|
|
130
|
-
f(fe, "Date", (e) => e.toISOString(), (e) => new Date(e)),
|
|
131
|
-
f(q, "Error", (e, t) => {
|
|
132
|
-
const r = {
|
|
133
|
-
name: e.name,
|
|
134
|
-
message: e.message
|
|
135
|
-
};
|
|
136
|
-
return "cause" in e && (r.cause = e.cause), t.allowedErrorProps.forEach((n) => {
|
|
137
|
-
r[n] = e[n];
|
|
138
|
-
}), r;
|
|
139
|
-
}, (e, t) => {
|
|
140
|
-
const r = new Error(e.message, { cause: e.cause });
|
|
141
|
-
return r.name = e.name, r.stack = e.stack, t.allowedErrorProps.forEach((n) => {
|
|
142
|
-
r[n] = e[n];
|
|
143
|
-
}), r;
|
|
144
|
-
}),
|
|
145
|
-
f(ue, "regexp", (e) => "" + e, (e) => {
|
|
146
|
-
const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
|
|
147
|
-
return new RegExp(t, r);
|
|
148
|
-
}),
|
|
149
|
-
f(
|
|
150
|
-
O,
|
|
151
|
-
"set",
|
|
152
|
-
// (sets only exist in es6+)
|
|
153
|
-
// eslint-disable-next-line es5/no-es6-methods
|
|
154
|
-
(e) => [...e.values()],
|
|
155
|
-
(e) => new Set(e)
|
|
156
|
-
),
|
|
157
|
-
f(I, "map", (e) => [...e.entries()], (e) => new Map(e)),
|
|
158
|
-
f((e) => B(e) || ge(e), "number", (e) => B(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
|
|
159
|
-
f((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
|
|
160
|
-
f(pe, "URL", (e) => e.toString(), (e) => new URL(e))
|
|
161
|
-
];
|
|
162
|
-
function P(e, t, r, n) {
|
|
163
|
-
return {
|
|
164
|
-
isApplicable: e,
|
|
165
|
-
annotation: t,
|
|
166
|
-
transform: r,
|
|
167
|
-
untransform: n
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const L = P((e, t) => M(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
|
|
171
|
-
const n = r.symbolRegistry.getValue(t[1]);
|
|
172
|
-
if (!n)
|
|
173
|
-
throw new Error("Trying to deserialize unknown symbol");
|
|
174
|
-
return n;
|
|
175
|
-
}), he = [
|
|
176
|
-
Int8Array,
|
|
177
|
-
Uint8Array,
|
|
178
|
-
Int16Array,
|
|
179
|
-
Uint16Array,
|
|
180
|
-
Int32Array,
|
|
181
|
-
Uint32Array,
|
|
182
|
-
Float32Array,
|
|
183
|
-
Float64Array,
|
|
184
|
-
Uint8ClampedArray
|
|
185
|
-
].reduce((e, t) => (e[t.name] = t, e), {}), $ = P(de, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
|
|
186
|
-
const r = he[t[1]];
|
|
187
|
-
if (!r)
|
|
188
|
-
throw new Error("Trying to deserialize unknown typed array");
|
|
189
|
-
return new r(e);
|
|
190
|
-
});
|
|
191
|
-
function F(e, t) {
|
|
192
|
-
return e?.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
|
|
193
|
-
}
|
|
194
|
-
const G = P(F, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
|
|
195
|
-
const r = t.classRegistry.getAllowedProps(e.constructor);
|
|
196
|
-
if (!r)
|
|
197
|
-
return { ...e };
|
|
198
|
-
const n = {};
|
|
199
|
-
return r.forEach((s) => {
|
|
200
|
-
n[s] = e[s];
|
|
201
|
-
}), n;
|
|
202
|
-
}, (e, t, r) => {
|
|
203
|
-
const n = r.classRegistry.getValue(t[1]);
|
|
204
|
-
if (!n)
|
|
205
|
-
throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
206
|
-
return Object.assign(Object.create(n.prototype), e);
|
|
207
|
-
}), H = P((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
|
|
208
|
-
const n = r.customTransformerRegistry.findByName(t[1]);
|
|
209
|
-
if (!n)
|
|
210
|
-
throw new Error("Trying to deserialize unknown custom value");
|
|
211
|
-
return n.deserialize(e);
|
|
212
|
-
}), we = [G, L, H, $], C = (e, t) => {
|
|
213
|
-
const r = z(we, (s) => s.isApplicable(e, t));
|
|
214
|
-
if (r)
|
|
215
|
-
return {
|
|
216
|
-
value: r.transform(e, t),
|
|
217
|
-
type: r.annotation(e, t)
|
|
218
|
-
};
|
|
219
|
-
const n = z(x, (s) => s.isApplicable(e, t));
|
|
220
|
-
if (n)
|
|
221
|
-
return {
|
|
222
|
-
value: n.transform(e, t),
|
|
223
|
-
type: n.annotation
|
|
224
|
-
};
|
|
225
|
-
}, Q = {};
|
|
226
|
-
x.forEach((e) => {
|
|
227
|
-
Q[e.annotation] = e;
|
|
228
|
-
});
|
|
229
|
-
const be = (e, t, r) => {
|
|
230
|
-
if (m(t))
|
|
231
|
-
switch (t[0]) {
|
|
232
|
-
case "symbol":
|
|
233
|
-
return L.untransform(e, t, r);
|
|
234
|
-
case "class":
|
|
235
|
-
return G.untransform(e, t, r);
|
|
236
|
-
case "custom":
|
|
237
|
-
return H.untransform(e, t, r);
|
|
238
|
-
case "typed-array":
|
|
239
|
-
return $.untransform(e, t, r);
|
|
240
|
-
default:
|
|
241
|
-
throw new Error("Unknown transformation: " + t);
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
const n = Q[t];
|
|
245
|
-
if (!n)
|
|
246
|
-
throw new Error("Unknown transformation: " + t);
|
|
247
|
-
return n.untransform(e, r);
|
|
248
|
-
}
|
|
249
|
-
}, p = (e, t) => {
|
|
250
|
-
if (t > e.size)
|
|
251
|
-
throw new Error("index out of bounds");
|
|
252
|
-
const r = e.keys();
|
|
253
|
-
for (; t > 0; )
|
|
254
|
-
r.next(), t--;
|
|
255
|
-
return r.next().value;
|
|
256
|
-
};
|
|
257
|
-
function W(e) {
|
|
258
|
-
if (A(e, "__proto__"))
|
|
259
|
-
throw new Error("__proto__ is not allowed as a property");
|
|
260
|
-
if (A(e, "prototype"))
|
|
261
|
-
throw new Error("prototype is not allowed as a property");
|
|
262
|
-
if (A(e, "constructor"))
|
|
263
|
-
throw new Error("constructor is not allowed as a property");
|
|
264
|
-
}
|
|
265
|
-
const Ee = (e, t) => {
|
|
266
|
-
W(t);
|
|
267
|
-
for (let r = 0; r < t.length; r++) {
|
|
268
|
-
const n = t[r];
|
|
269
|
-
if (O(e))
|
|
270
|
-
e = p(e, +n);
|
|
271
|
-
else if (I(e)) {
|
|
272
|
-
const s = +n, i = +t[++r] == 0 ? "key" : "value", o = p(e, s);
|
|
273
|
-
switch (i) {
|
|
274
|
-
case "key":
|
|
275
|
-
e = o;
|
|
276
|
-
break;
|
|
277
|
-
case "value":
|
|
278
|
-
e = e.get(o);
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
} else
|
|
282
|
-
e = e[n];
|
|
283
|
-
}
|
|
284
|
-
return e;
|
|
285
|
-
}, V = (e, t, r) => {
|
|
286
|
-
if (W(t), t.length === 0)
|
|
287
|
-
return r(e);
|
|
288
|
-
let n = e;
|
|
289
|
-
for (let i = 0; i < t.length - 1; i++) {
|
|
290
|
-
const o = t[i];
|
|
291
|
-
if (m(n)) {
|
|
292
|
-
const l = +o;
|
|
293
|
-
n = n[l];
|
|
294
|
-
} else if (R(n))
|
|
295
|
-
n = n[o];
|
|
296
|
-
else if (O(n)) {
|
|
297
|
-
const l = +o;
|
|
298
|
-
n = p(n, l);
|
|
299
|
-
} else if (I(n)) {
|
|
300
|
-
if (i === t.length - 2)
|
|
301
|
-
break;
|
|
302
|
-
const c = +o, g = +t[++i] == 0 ? "key" : "value", d = p(n, c);
|
|
303
|
-
switch (g) {
|
|
304
|
-
case "key":
|
|
305
|
-
n = d;
|
|
306
|
-
break;
|
|
307
|
-
case "value":
|
|
308
|
-
n = n.get(d);
|
|
309
|
-
break;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const s = t[t.length - 1];
|
|
314
|
-
if (m(n) ? n[+s] = r(n[+s]) : R(n) && (n[s] = r(n[s])), O(n)) {
|
|
315
|
-
const i = p(n, +s), o = r(i);
|
|
316
|
-
i !== o && (n.delete(i), n.add(o));
|
|
317
|
-
}
|
|
318
|
-
if (I(n)) {
|
|
319
|
-
const i = +t[t.length - 2], o = p(n, i);
|
|
320
|
-
switch (+s == 0 ? "key" : "value") {
|
|
321
|
-
case "key": {
|
|
322
|
-
const c = r(o);
|
|
323
|
-
n.set(c, n.get(o)), c !== o && n.delete(o);
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
case "value": {
|
|
327
|
-
n.set(o, r(n.get(o)));
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
return e;
|
|
333
|
-
}, X = (e) => e < 1;
|
|
334
|
-
function v(e, t, r, n = []) {
|
|
335
|
-
if (!e)
|
|
336
|
-
return;
|
|
337
|
-
const s = X(r);
|
|
338
|
-
if (!m(e)) {
|
|
339
|
-
h(e, (l, c) => v(l, t, r, [
|
|
340
|
-
...n,
|
|
341
|
-
...E(c, s)
|
|
342
|
-
]));
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const [i, o] = e;
|
|
346
|
-
o && h(o, (l, c) => {
|
|
347
|
-
v(l, t, r, [
|
|
348
|
-
...n,
|
|
349
|
-
...E(c, s)
|
|
350
|
-
]);
|
|
351
|
-
}), t(i, n);
|
|
352
|
-
}
|
|
353
|
-
function Re(e, t, r, n) {
|
|
354
|
-
return v(t, (s, i) => {
|
|
355
|
-
e = V(e, i, (o) => be(o, s, n));
|
|
356
|
-
}, r), e;
|
|
357
|
-
}
|
|
358
|
-
function Ie(e, t, r) {
|
|
359
|
-
const n = X(r);
|
|
360
|
-
function s(i, o) {
|
|
361
|
-
const l = Ee(e, E(o, n));
|
|
362
|
-
i.map((c) => E(c, n)).forEach((c) => {
|
|
363
|
-
e = V(e, c, () => l);
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
if (m(t)) {
|
|
367
|
-
const [i, o] = t;
|
|
368
|
-
i.forEach((l) => {
|
|
369
|
-
e = V(e, E(l, n), () => e);
|
|
370
|
-
}), o && h(o, s);
|
|
371
|
-
} else
|
|
372
|
-
h(t, s);
|
|
373
|
-
return e;
|
|
374
|
-
}
|
|
375
|
-
const Oe = (e, t) => R(e) || m(e) || I(e) || O(e) || q(e) || F(e, t);
|
|
376
|
-
function Ae(e, t, r) {
|
|
377
|
-
const n = r.get(e);
|
|
378
|
-
n ? n.push(t) : r.set(e, [t]);
|
|
379
|
-
}
|
|
380
|
-
function Pe(e, t) {
|
|
381
|
-
const r = {};
|
|
382
|
-
let n;
|
|
383
|
-
return e.forEach((s) => {
|
|
384
|
-
if (s.length <= 1)
|
|
385
|
-
return;
|
|
386
|
-
t || (s = s.map((l) => l.map(String)).sort((l, c) => l.length - c.length));
|
|
387
|
-
const [i, ...o] = s;
|
|
388
|
-
i.length === 0 ? n = o.map(k) : r[k(i)] = o.map(k);
|
|
389
|
-
}), n ? T(r) ? [n] : [n, r] : T(r) ? void 0 : r;
|
|
390
|
-
}
|
|
391
|
-
const Y = (e, t, r, n, s = [], i = [], o = /* @__PURE__ */ new Map()) => {
|
|
392
|
-
const l = ye(e);
|
|
393
|
-
if (!l) {
|
|
394
|
-
Ae(e, s, t);
|
|
395
|
-
const y = o.get(e);
|
|
396
|
-
if (y)
|
|
397
|
-
return n ? {
|
|
398
|
-
transformedValue: null
|
|
399
|
-
} : y;
|
|
400
|
-
}
|
|
401
|
-
if (!Oe(e, r)) {
|
|
402
|
-
const y = C(e, r), u = y ? {
|
|
403
|
-
transformedValue: y.value,
|
|
404
|
-
annotations: [y.type]
|
|
405
|
-
} : {
|
|
406
|
-
transformedValue: e
|
|
407
|
-
};
|
|
408
|
-
return l || o.set(e, u), u;
|
|
409
|
-
}
|
|
410
|
-
if (A(i, e))
|
|
411
|
-
return {
|
|
412
|
-
transformedValue: null
|
|
413
|
-
};
|
|
414
|
-
const c = C(e, r), g = c?.value ?? e, d = m(g) ? [] : {}, w = {};
|
|
415
|
-
h(g, (y, u) => {
|
|
416
|
-
if (u === "__proto__" || u === "constructor" || u === "prototype")
|
|
417
|
-
throw new Error(`Detected property ${u}. This is a prototype pollution risk, please remove it from your object.`);
|
|
418
|
-
const b = Y(y, t, r, n, [...s, u], [...i, e], o);
|
|
419
|
-
d[u] = b.transformedValue, m(b.annotations) ? w[S(u)] = b.annotations : R(b.annotations) && h(b.annotations, (j, J) => {
|
|
420
|
-
w[S(u) + "." + J] = j;
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
const _ = T(w) ? {
|
|
424
|
-
transformedValue: d,
|
|
425
|
-
annotations: c ? [c.type] : void 0
|
|
426
|
-
} : {
|
|
427
|
-
transformedValue: d,
|
|
428
|
-
annotations: c ? [c.type, w] : w
|
|
429
|
-
};
|
|
430
|
-
return l || o.set(e, _), _;
|
|
431
|
-
};
|
|
432
|
-
function Z(e) {
|
|
433
|
-
return Object.prototype.toString.call(e).slice(8, -1);
|
|
434
|
-
}
|
|
435
|
-
function D(e) {
|
|
436
|
-
return Z(e) === "Array";
|
|
437
|
-
}
|
|
438
|
-
function ke(e) {
|
|
439
|
-
if (Z(e) !== "Object")
|
|
440
|
-
return !1;
|
|
441
|
-
const t = Object.getPrototypeOf(e);
|
|
442
|
-
return !!t && t.constructor === Object && t === Object.prototype;
|
|
443
|
-
}
|
|
444
|
-
function Te(e, t, r, n, s) {
|
|
445
|
-
const i = {}.propertyIsEnumerable.call(n, t) ? "enumerable" : "nonenumerable";
|
|
446
|
-
i === "enumerable" && (e[t] = r), s && i === "nonenumerable" && Object.defineProperty(e, t, {
|
|
447
|
-
value: r,
|
|
448
|
-
enumerable: !1,
|
|
449
|
-
writable: !0,
|
|
450
|
-
configurable: !0
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
function N(e, t = {}) {
|
|
454
|
-
if (D(e))
|
|
455
|
-
return e.map((s) => N(s, t));
|
|
456
|
-
if (!ke(e))
|
|
457
|
-
return e;
|
|
458
|
-
const r = Object.getOwnPropertyNames(e), n = Object.getOwnPropertySymbols(e);
|
|
459
|
-
return [...r, ...n].reduce((s, i) => {
|
|
460
|
-
if (i === "__proto__" || D(t.props) && !t.props.includes(i))
|
|
461
|
-
return s;
|
|
462
|
-
const o = e[i], l = N(o, t);
|
|
463
|
-
return Te(s, i, l, e, t.nonenumerable), s;
|
|
464
|
-
}, {});
|
|
465
|
-
}
|
|
466
|
-
class a {
|
|
467
|
-
/**
|
|
468
|
-
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
469
|
-
*/
|
|
470
|
-
constructor({ dedupe: t = !1 } = {}) {
|
|
471
|
-
this.classRegistry = new te(), this.symbolRegistry = new K((r) => r.description ?? ""), this.customTransformerRegistry = new se(), this.allowedErrorProps = [], this.dedupe = t;
|
|
472
|
-
}
|
|
473
|
-
serialize(t) {
|
|
474
|
-
const r = /* @__PURE__ */ new Map(), n = Y(t, r, this, this.dedupe), s = {
|
|
475
|
-
json: n.transformedValue
|
|
476
|
-
};
|
|
477
|
-
n.annotations && (s.meta = {
|
|
478
|
-
...s.meta,
|
|
479
|
-
values: n.annotations
|
|
480
|
-
});
|
|
481
|
-
const i = Pe(r, this.dedupe);
|
|
482
|
-
return i && (s.meta = {
|
|
483
|
-
...s.meta,
|
|
484
|
-
referentialEqualities: i
|
|
485
|
-
}), s.meta && (s.meta.v = 1), s;
|
|
486
|
-
}
|
|
487
|
-
deserialize(t, r) {
|
|
488
|
-
const { json: n, meta: s } = t;
|
|
489
|
-
let i = r?.inPlace ? n : N(n);
|
|
490
|
-
return s?.values && (i = Re(i, s.values, s.v ?? 0, this)), s?.referentialEqualities && (i = Ie(i, s.referentialEqualities, s.v ?? 0)), i;
|
|
491
|
-
}
|
|
492
|
-
stringify(t) {
|
|
493
|
-
return JSON.stringify(this.serialize(t));
|
|
494
|
-
}
|
|
495
|
-
parse(t) {
|
|
496
|
-
return this.deserialize(JSON.parse(t), { inPlace: !0 });
|
|
497
|
-
}
|
|
498
|
-
registerClass(t, r) {
|
|
499
|
-
this.classRegistry.register(t, r);
|
|
500
|
-
}
|
|
501
|
-
registerSymbol(t, r) {
|
|
502
|
-
this.symbolRegistry.register(t, r);
|
|
503
|
-
}
|
|
504
|
-
registerCustom(t, r) {
|
|
505
|
-
this.customTransformerRegistry.register({
|
|
506
|
-
name: r,
|
|
507
|
-
...t
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
allowErrorProps(...t) {
|
|
511
|
-
this.allowedErrorProps.push(...t);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
a.defaultInstance = new a();
|
|
515
|
-
a.serialize = a.defaultInstance.serialize.bind(a.defaultInstance);
|
|
516
|
-
a.deserialize = a.defaultInstance.deserialize.bind(a.defaultInstance);
|
|
517
|
-
a.stringify = a.defaultInstance.stringify.bind(a.defaultInstance);
|
|
518
|
-
a.parse = a.defaultInstance.parse.bind(a.defaultInstance);
|
|
519
|
-
a.registerClass = a.defaultInstance.registerClass.bind(a.defaultInstance);
|
|
520
|
-
a.registerSymbol = a.defaultInstance.registerSymbol.bind(a.defaultInstance);
|
|
521
|
-
a.registerCustom = a.defaultInstance.registerCustom.bind(a.defaultInstance);
|
|
522
|
-
a.allowErrorProps = a.defaultInstance.allowErrorProps.bind(a.defaultInstance);
|
|
523
|
-
a.serialize;
|
|
524
|
-
a.deserialize;
|
|
525
|
-
a.stringify;
|
|
526
|
-
a.parse;
|
|
527
|
-
a.registerClass;
|
|
528
|
-
a.registerCustom;
|
|
529
|
-
a.registerSymbol;
|
|
530
|
-
a.allowErrorProps;
|
|
531
|
-
export {
|
|
532
|
-
a as S
|
|
533
|
-
};
|