Skip to content

Commit 00b837a

Browse files
committed
Update bundle after vite update
1 parent d74bf4e commit 00b837a

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

dist/deserialize.js

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
1-
import y from "@ungap/structured-clone";
2-
function A(e, r = {}) {
3-
const s = y(e);
4-
r || (r = {});
5-
const n = s.included || [];
6-
return Array.isArray(s.data) ? s.data.map((i) => f(i, n, !1)) : f(
1+
function y(e, t = {}) {
2+
const s = structuredClone(e);
3+
t || (t = {});
4+
const o = s.included || [];
5+
return Array.isArray(s.data) ? s.data.map((i) => f(i, o, !1)) : f(
76
s.data,
8-
n,
7+
o,
98
!1
109
);
1110
}
12-
function f(e, r, s, n) {
13-
if (r.cached || (r.cached = {}), e.type in r.cached || (r.cached[e.type] = {}), s && e.id in r.cached[e.type])
14-
return r.cached[e.type][e.id];
15-
const t = e.attributes || {};
16-
if (t.id = e.id, r.cached[e.type][e.id] = t, e.relationships)
11+
function f(e, t, s, o) {
12+
if (t.cached || (t.cached = {}), e.type in t.cached || (t.cached[e.type] = {}), s && e.id in t.cached[e.type])
13+
return t.cached[e.type][e.id];
14+
const r = e.attributes || {};
15+
if (r.id = e.id, t.cached[e.type][e.id] = r, e.relationships)
1716
for (const c of Object.keys(e.relationships)) {
18-
const o = e.relationships[c];
19-
if (Array.isArray(o.data)) {
17+
const n = e.relationships[c];
18+
if (Array.isArray(n.data)) {
2019
const p = [];
21-
o.data.forEach((a) => {
20+
n.data.forEach((a) => {
2221
const h = u(
23-
r,
22+
t,
2423
a.type,
2524
a.id
2625
);
2726
p.push(h);
28-
}), t[c] = p;
29-
} else o && o.data ? t[c] = u(
30-
r,
31-
o.data.type,
32-
o.data.id
33-
) : t[c] = null;
27+
}), r[c] = p;
28+
} else n && n.data ? r[c] = u(
29+
t,
30+
n.data.type,
31+
n.data.id
32+
) : r[c] = null;
3433
}
35-
return t;
34+
return r;
3635
}
37-
function u(e, r, s, n) {
36+
function u(e, t, s, o) {
3837
let i = null;
39-
return e.forEach((t) => {
40-
t.type === r && t.id === s && (i = f(t, e, !0));
38+
return e.forEach((r) => {
39+
r.type === t && r.id === s && (i = f(r, e, !0));
4140
}), i || (i = { id: s }), i;
4241
}
4342
export {
44-
A as deserialize
43+
y as deserialize
4544
};

0 commit comments

Comments
 (0)