@dialecte/core 0.2.9 → 0.2.11

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/test.js CHANGED
@@ -1,141 +1,141 @@
1
1
  import { expect as m, it as p } from "vitest";
2
- import { x as D, D as w, P as L } from "./index-1D8DELEq.js";
3
- import { D as T, s as g, o as O, n as M } from "./merge-extensions-dj7By9gG.js";
4
- function v(B) {
5
- const e = k(B);
2
+ import { x as L, D as T, P as w } from "./index-BdP_eGXx.js";
3
+ import { D as g, s as O, o as M, n as k } from "./merge-extensions-dj7By9gG.js";
4
+ function E(a) {
5
+ const e = R(a);
6
6
  if (e.length === 0)
7
- return [B];
7
+ return [a];
8
8
  const t = [];
9
9
  for (const r of e)
10
- t.push(B.slice(0, r));
11
- return t.push(B), t;
10
+ t.push(a.slice(0, r));
11
+ return t.push(a), t;
12
12
  }
13
- function k(B) {
13
+ function R(a) {
14
14
  const e = [];
15
- let t = 0, r = 0, a = null;
16
- for (let C = 0; C < B.length; C++) {
17
- const A = B[C];
18
- if (a) {
19
- A === a && (a = null);
15
+ let t = 0, r = 0, B = null;
16
+ for (let A = 0; A < a.length; A++) {
17
+ const _ = a[A];
18
+ if (B) {
19
+ _ === B && (B = null);
20
20
  continue;
21
21
  }
22
- if (A === '"' || A === "'") {
23
- a = A;
22
+ if (_ === '"' || _ === "'") {
23
+ B = _;
24
24
  continue;
25
25
  }
26
- if (A === "[") {
26
+ if (_ === "[") {
27
27
  t++;
28
28
  continue;
29
29
  }
30
- if (A === "]") {
30
+ if (_ === "]") {
31
31
  t--;
32
32
  continue;
33
33
  }
34
- if (A === "(") {
34
+ if (_ === "(") {
35
35
  r++;
36
36
  continue;
37
37
  }
38
- if (A === ")") {
38
+ if (_ === ")") {
39
39
  r--;
40
40
  continue;
41
41
  }
42
- if (!(t > 0 || r > 0) && A === "/") {
43
- if (C === 0) {
44
- B[C + 1] === "/" && C++;
42
+ if (!(t > 0 || r > 0) && _ === "/") {
43
+ if (A === 0) {
44
+ a[A + 1] === "/" && A++;
45
45
  continue;
46
46
  }
47
- if (e.length === 0 && C === 1 && B[0] === "/")
47
+ if (e.length === 0 && A === 1 && a[0] === "/")
48
48
  continue;
49
- e.push(C), B[C + 1] === "/" && C++;
49
+ e.push(A), a[A + 1] === "/" && A++;
50
50
  }
51
51
  }
52
52
  return e;
53
53
  }
54
- function R(B) {
55
- const { namespaces: e } = B, t = F(e);
54
+ function V(a) {
55
+ const { namespaces: e } = a, t = y(e);
56
56
  return {
57
57
  assertExpectedElementQueries(r) {
58
- V({ ...r, nsResolver: t });
58
+ F({ ...r, nsResolver: t });
59
59
  },
60
60
  assertUnexpectedElementQueries(r) {
61
- y({ ...r, nsResolver: t });
61
+ I({ ...r, nsResolver: t });
62
62
  }
63
63
  };
64
64
  }
65
- function V(B) {
66
- const { xmlDocument: e, queries: t, nsResolver: r } = B;
67
- for (const a of t)
68
- I({ xmlDocument: e, xpath: a, nsResolver: r });
65
+ function F(a) {
66
+ const { xmlDocument: e, queries: t, nsResolver: r } = a;
67
+ for (const B of t)
68
+ U({ xmlDocument: e, xpath: B, nsResolver: r });
69
69
  }
70
- function F(B) {
71
- return (e) => e ? B[e]?.uri ?? null : null;
70
+ function y(a) {
71
+ return (e) => e ? a[e]?.uri ?? null : null;
72
72
  }
73
- function y(B) {
74
- const { xmlDocument: e, queries: t, nsResolver: r } = B;
75
- for (const a of t)
76
- U({ xmlDocument: e, xpath: a, nsResolver: r });
73
+ function I(a) {
74
+ const { xmlDocument: e, queries: t, nsResolver: r } = a;
75
+ for (const B of t)
76
+ N({ xmlDocument: e, xpath: B, nsResolver: r });
77
77
  }
78
- function I(B) {
79
- const { xmlDocument: e, xpath: t, nsResolver: r } = B, a = v(t);
80
- let C = null, A = 0;
81
- for (let s = 0; s < a.length; s++) {
82
- const _ = a[s], c = e.evaluate(
83
- _,
78
+ function U(a) {
79
+ const { xmlDocument: e, xpath: t, nsResolver: r } = a, B = E(t);
80
+ let A = null, _ = 0;
81
+ for (let C = 0; C < B.length; C++) {
82
+ const s = B[C], n = e.evaluate(
83
+ s,
84
84
  e,
85
85
  r ?? null,
86
86
  XPathResult.FIRST_ORDERED_NODE_TYPE,
87
87
  null
88
88
  ).singleNodeValue;
89
- if (c) {
90
- C = c, A = s + 1;
89
+ if (n) {
90
+ A = n, _ = C + 1;
91
91
  continue;
92
92
  }
93
- const n = s === 0 ? a[0] : t.slice(a[s - 1].length), u = A === 0 ? `[No parent matched — failed from document root]
93
+ const i = C === 0 ? B[0] : t.slice(B[C - 1].length), u = _ === 0 ? `[No parent matched — failed from document root]
94
94
  Document:
95
- ${x({ xml: new XMLSerializer().serializeToString(e) })}` : `[Last match at step ${A}/${a.length}]:
96
- ${C ? x({ xml: C.outerHTML }) : "(none)"}`;
95
+ ${x({ xml: new XMLSerializer().serializeToString(e) })}` : `[Last match at step ${_}/${B.length}]:
96
+ ${A ? x({ xml: A.outerHTML }) : "(none)"}`;
97
97
  m(
98
- c,
98
+ n,
99
99
  `Element not found in XML.
100
- Failed at step ${s + 1}/${a.length}: ${n.trim()}
100
+ Failed at step ${C + 1}/${B.length}: ${i.trim()}
101
101
  Full XPath: ${t}
102
102
  ${u}`
103
103
  ).toBeTruthy();
104
104
  return;
105
105
  }
106
106
  }
107
- function x(B) {
108
- const { xml: e } = B;
107
+ function x(a) {
108
+ const { xml: e } = a;
109
109
  try {
110
- return D(e, { indentation: " ", collapseContent: !0 });
110
+ return L(e, { indentation: " ", collapseContent: !0 });
111
111
  } catch {
112
112
  return e;
113
113
  }
114
114
  }
115
- function U(B) {
116
- const { xmlDocument: e, xpath: t, nsResolver: r } = B, a = v(t);
117
- if (a.length > 1) {
118
- let s = null;
119
- for (let _ = 0; _ < a.length - 1; _++) {
120
- const i = a[_], n = e.evaluate(
121
- i,
115
+ function N(a) {
116
+ const { xmlDocument: e, xpath: t, nsResolver: r } = a, B = E(t);
117
+ if (B.length > 1) {
118
+ let C = null;
119
+ for (let s = 0; s < B.length - 1; s++) {
120
+ const c = B[s], i = e.evaluate(
121
+ c,
122
122
  e,
123
123
  r ?? null,
124
124
  XPathResult.FIRST_ORDERED_NODE_TYPE,
125
125
  null
126
- ).singleNodeValue, u = _ === 0 ? a[0] : t.slice(a[_ - 1].length), o = _ === 0 ? "[Document root — no parent context]" : `[Parent element found at step ${_}]:
127
- ${s ? x({ xml: s.outerHTML }) : "(none)"}`;
126
+ ).singleNodeValue, u = s === 0 ? B[0] : t.slice(B[s - 1].length), o = s === 0 ? "[Document root — no parent context]" : `[Parent element found at step ${s}]:
127
+ ${C ? x({ xml: C.outerHTML }) : "(none)"}`;
128
128
  m(
129
- n,
129
+ i,
130
130
  `Absent assertion is unreliable: ancestor step does not exist.
131
131
  The query passes but for the wrong reason — an ancestor is missing, not the target element.
132
- Missing at step ${_ + 1}/${a.length}: ${u.trim()}
132
+ Missing at step ${s + 1}/${B.length}: ${u.trim()}
133
133
  Full XPath: ${t}
134
134
  ${o}`
135
- ).toBeTruthy(), s = n;
135
+ ).toBeTruthy(), C = i;
136
136
  }
137
137
  }
138
- const A = e.evaluate(
138
+ const _ = e.evaluate(
139
139
  t,
140
140
  e,
141
141
  r ?? null,
@@ -143,11 +143,11 @@ ${s ? x({ xml: s.outerHTML }) : "(none)"}`;
143
143
  null
144
144
  ).singleNodeValue;
145
145
  m(
146
- A,
146
+ _,
147
147
  `Element should NOT exist in XML but was found.
148
148
  XPath: ${t}
149
149
  Found:
150
- ${A ? x({ xml: A.outerHTML }) : "(none)"}`
150
+ ${_ ? x({ xml: _.outerHTML }) : "(none)"}`
151
151
  ).toBeFalsy();
152
152
  }
153
153
  const d = {
@@ -155,12 +155,12 @@ const d = {
155
155
  uri: "http://dialecte.dev/XML/DEFAULT",
156
156
  prefix: ""
157
157
  },
158
- dev: T,
158
+ dev: g,
159
159
  ext: {
160
160
  uri: "http://dialecte.dev/XML/DEV-EXT",
161
161
  prefix: "ext"
162
162
  }
163
- }, Ce = `xmlns="${d.default.uri}"`, _e = `xmlns:${d.dev.prefix}="${d.dev.uri}"`, se = `xmlns:${d.ext.prefix}="${d.ext.uri}"`, N = [
163
+ }, _e = `xmlns="${d.default.uri}"`, se = `xmlns:${d.dev.prefix}="${d.dev.uri}"`, ce = `xmlns:${d.ext.prefix}="${d.ext.uri}"`, $ = [
164
164
  "A",
165
165
  "AAAA_1",
166
166
  "AAAA_2",
@@ -192,7 +192,7 @@ const d = {
192
192
  "CC_2",
193
193
  "CC_3",
194
194
  "Root"
195
- ], $ = {
195
+ ], P = {
196
196
  A: ["AA_1", "AA_2", "AA_3"],
197
197
  AAAA_1: [],
198
198
  AAAA_2: [],
@@ -224,7 +224,7 @@ const d = {
224
224
  CC_2: ["CCC_1", "CCC_2", "CCC_3"],
225
225
  CC_3: ["CCC_1", "CCC_2", "CCC_3"],
226
226
  Root: ["A", "B", "C"]
227
- }, P = {
227
+ }, Q = {
228
228
  A: ["Root"],
229
229
  AAAA_1: ["AAA_1", "AAA_2", "AAA_3"],
230
230
  AAAA_2: ["AAA_1", "AAA_2", "AAA_3"],
@@ -256,7 +256,7 @@ const d = {
256
256
  CC_2: ["C"],
257
257
  CC_3: ["C"],
258
258
  Root: []
259
- }, Q = {
259
+ }, j = {
260
260
  A: ["AAAA_1", "AAAA_2", "AAAA_3", "AAA_1", "AAA_2", "AAA_3", "AA_1", "AA_2", "AA_3"],
261
261
  AAAA_1: [],
262
262
  AAAA_2: [],
@@ -319,7 +319,7 @@ const d = {
319
319
  "CC_2",
320
320
  "CC_3"
321
321
  ]
322
- }, j = {
322
+ }, z = {
323
323
  A: ["Root"],
324
324
  AAAA_1: ["A", "AAA_1", "AAA_2", "AAA_3", "AA_1", "AA_2", "AA_3", "Root"],
325
325
  AAAA_2: ["A", "AAA_1", "AAA_2", "AAA_3", "AA_1", "AA_2", "AA_3", "Root"],
@@ -351,7 +351,7 @@ const d = {
351
351
  CC_2: ["C", "Root"],
352
352
  CC_3: ["C", "Root"],
353
353
  Root: []
354
- }, z = "Root", G = ["A", "AA_1", "B", "BB_1", "C", "CC_1", "CC_2", "Root"], H = {
354
+ }, G = "Root", H = ["A", "AA_1", "B", "BB_1", "C", "CC_1", "CC_2", "Root"], Y = {
355
355
  A: {
356
356
  aA: "",
357
357
  bA: "",
@@ -440,8 +440,6 @@ const d = {
440
440
  BB_1: {
441
441
  aBB_1: "",
442
442
  bBB_1: "",
443
- dBB_1: "",
444
- eBB_1: "",
445
443
  "ext:cBB_1": ""
446
444
  },
447
445
  BB_2: {
@@ -508,7 +506,7 @@ const d = {
508
506
  "ext:root": "",
509
507
  root: ""
510
508
  }
511
- }, Y = {
509
+ }, K = {
512
510
  A: {
513
511
  tag: "A",
514
512
  namespace: { prefix: "", uri: "http://dialecte.dev/XML/DEFAULT" },
@@ -840,7 +838,7 @@ const d = {
840
838
  selector: [{ steps: [{ kind: "name", value: "BB_1" }] }],
841
839
  fields: [
842
840
  { target: { kind: "attribute", value: "aBB_1", isAttribute: !0 } },
843
- { target: { kind: "attribute", value: "dBB_1", isAttribute: !0 } }
841
+ { target: { kind: "attribute", value: "bBB_1", isAttribute: !0 } }
844
842
  ]
845
843
  },
846
844
  {
@@ -932,7 +930,7 @@ const d = {
932
930
  sequence: ["aBBB_1", "bBBB_1", "ext:cBBB_1"],
933
931
  details: {
934
932
  aBBB_1: { required: !0, facets: { whiteSpace: "preserve" } },
935
- bBBB_1: { facets: { whiteSpace: "preserve" } },
933
+ bBBB_1: { default: "false", facets: { whiteSpace: "preserve" } },
936
934
  "ext:cBBB_1": {
937
935
  namespace: { prefix: "ext", uri: "http://dialecte.dev/XML/DEV-EXT" },
938
936
  facets: { whiteSpace: "preserve" }
@@ -1020,18 +1018,16 @@ const d = {
1020
1018
  namespace: { prefix: "", uri: "http://dialecte.dev/XML/DEFAULT" },
1021
1019
  parents: ["B"],
1022
1020
  attributes: {
1023
- sequence: ["aBB_1", "bBB_1", "dBB_1", "eBB_1", "ext:cBB_1"],
1021
+ sequence: ["aBB_1", "bBB_1", "ext:cBB_1"],
1024
1022
  details: {
1025
1023
  aBB_1: { required: !0, facets: { whiteSpace: "preserve" } },
1026
- bBB_1: { facets: { whiteSpace: "preserve" } },
1027
- dBB_1: { default: "", facets: { whiteSpace: "preserve" } },
1028
- eBB_1: { default: "", facets: { whiteSpace: "preserve" } },
1024
+ bBB_1: { default: "", facets: { whiteSpace: "preserve" } },
1029
1025
  "ext:cBB_1": {
1030
1026
  namespace: { prefix: "ext", uri: "http://dialecte.dev/XML/DEV-EXT" },
1031
1027
  facets: { whiteSpace: "preserve" }
1032
1028
  }
1033
1029
  },
1034
- identityFields: ["aBB_1", "dBB_1"]
1030
+ identityFields: ["aBB_1", "bBB_1"]
1035
1031
  },
1036
1032
  children: {
1037
1033
  sequence: ["BBB_1", "BBB_2", "BBB_3"],
@@ -1080,7 +1076,7 @@ const d = {
1080
1076
  sequence: ["aBB_2", "bBB_2", "ext:cBB_2"],
1081
1077
  details: {
1082
1078
  aBB_2: { required: !0, facets: { whiteSpace: "preserve" } },
1083
- bBB_2: { facets: { whiteSpace: "preserve" } },
1079
+ bBB_2: { default: "", facets: { whiteSpace: "preserve" } },
1084
1080
  "ext:cBB_2": {
1085
1081
  namespace: { prefix: "ext", uri: "http://dialecte.dev/XML/DEV-EXT" },
1086
1082
  facets: { whiteSpace: "preserve" }
@@ -1492,7 +1488,7 @@ const d = {
1492
1488
  selector: [{ steps: [{ kind: "name", value: "BB_1" }] }],
1493
1489
  fields: [
1494
1490
  { target: { kind: "attribute", value: "aBB_1", isAttribute: !0 } },
1495
- { target: { kind: "attribute", value: "dBB_1", isAttribute: !0 } }
1491
+ { target: { kind: "attribute", value: "bBB_1", isAttribute: !0 } }
1496
1492
  ]
1497
1493
  },
1498
1494
  {
@@ -1533,9 +1529,9 @@ const d = {
1533
1529
  }
1534
1530
  ]
1535
1531
  }
1536
- }, K = {
1537
- supportedFileExtensions: [".xml"]
1538
1532
  }, W = {
1533
+ supportedFileExtensions: [".xml"]
1534
+ }, Z = {
1539
1535
  recordSchema: {
1540
1536
  primaryKey: "id",
1541
1537
  indexes: ["tagName", "parent.id", "parent.tagName"],
@@ -1550,172 +1546,179 @@ const d = {
1550
1546
  }
1551
1547
  }
1552
1548
  }, l = {
1553
- rootElementName: z,
1554
- singletonElements: G,
1555
- elements: N,
1549
+ rootElementName: G,
1550
+ singletonElements: H,
1551
+ elements: $,
1556
1552
  namespaces: d,
1557
- attributes: H,
1558
- children: $,
1559
- parents: P,
1560
- descendants: Q,
1561
- ancestors: j,
1562
- database: W,
1563
- io: K,
1564
- definition: Y
1553
+ attributes: Y,
1554
+ children: P,
1555
+ parents: Q,
1556
+ descendants: j,
1557
+ ancestors: z,
1558
+ database: Z,
1559
+ io: W,
1560
+ definition: K
1565
1561
  };
1566
- async function E(B) {
1562
+ async function b(a) {
1567
1563
  const {
1568
1564
  sourceXml: e,
1569
1565
  targetXml: t,
1570
1566
  dialecteConfig: r = l,
1571
- hooks: a
1572
- } = B, C = `test-${crypto.randomUUID()}`, A = await new L({
1567
+ extensions: B,
1568
+ hooks: A
1569
+ } = a, _ = `test-${crypto.randomUUID()}`, C = await new w({
1573
1570
  configs: { default: r },
1574
1571
  defaultConfigKey: "default",
1575
1572
  storage: { type: "local" },
1576
- hooks: a
1577
- }).open(C), [s] = await A.import(
1573
+ extensions: B,
1574
+ hooks: A
1575
+ }).open(_), [s] = await C.import(
1578
1576
  [new File([e], "source.xml", { type: "text/xml" })],
1579
1577
  { useCustomRecordsIds: !0 }
1580
- ), _ = {
1578
+ ), c = {
1581
1579
  documentId: s.documentId,
1582
- document: A.openDocument(s.documentId)
1580
+ document: C.openDocument(s.documentId)
1583
1581
  };
1584
- let i;
1582
+ let n;
1585
1583
  if (t) {
1586
- const [c] = await A.import(
1584
+ const [i] = await C.import(
1587
1585
  [new File([t], "target.xml", { type: "text/xml" })],
1588
1586
  { useCustomRecordsIds: !0 }
1589
1587
  );
1590
- i = {
1591
- documentId: c.documentId,
1592
- document: A.openDocument(c.documentId)
1588
+ n = {
1589
+ documentId: i.documentId,
1590
+ document: C.openDocument(i.documentId)
1593
1591
  };
1594
1592
  }
1595
- return { project: A, source: _, target: i };
1593
+ return { project: C, source: c, target: n };
1596
1594
  }
1597
- async function ce(B) {
1598
- const { databaseName: e, dialecteConfig: t, documentId: r } = B, a = new w(e, {
1595
+ async function ie(a) {
1596
+ const { databaseName: e, dialecteConfig: t, documentId: r } = a, B = new T(e, {
1599
1597
  recordSchema: t.database.recordSchema
1600
1598
  });
1601
- return await a.open(), {
1599
+ return await B.open(), {
1602
1600
  dialecteConfig: t,
1603
- store: a,
1601
+ store: B,
1604
1602
  documentId: r,
1605
1603
  recordCache: /* @__PURE__ */ new Map(),
1606
1604
  stagedOperations: []
1607
1605
  };
1608
1606
  }
1609
- const b = crypto.randomUUID.bind(crypto);
1610
- function X() {
1611
- let B = 0;
1607
+ const X = crypto.randomUUID.bind(crypto);
1608
+ function q() {
1609
+ let a = 0;
1612
1610
  return function() {
1613
- return `${B++}`;
1611
+ return `${a++}`;
1614
1612
  };
1615
1613
  }
1616
- function Z(B) {
1614
+ function J(a) {
1617
1615
  const {
1618
1616
  testCases: e,
1619
1617
  act: t,
1620
- hooks: r,
1621
- dialecteConfig: a = l
1622
- } = B, { assertExpectedElementQueries: C, assertUnexpectedElementQueries: A } = R({
1623
- namespaces: a.namespaces
1618
+ extensions: r,
1619
+ hooks: B,
1620
+ dialecteConfig: A = l
1621
+ } = a, { assertExpectedElementQueries: _, assertUnexpectedElementQueries: C } = V({
1622
+ namespaces: A.namespaces
1624
1623
  });
1625
- for (const [s, _] of Object.entries(e))
1626
- (_.only ? p.only : p)(s, async () => {
1627
- crypto.randomUUID = b;
1628
- const { project: c, source: n, target: u } = await E({
1629
- sourceXml: _.sourceXml,
1630
- targetXml: _.targetXml,
1631
- dialecteConfig: a,
1632
- hooks: r
1624
+ for (const [s, c] of Object.entries(e))
1625
+ (c.only ? p.only : p)(s, async () => {
1626
+ crypto.randomUUID = X;
1627
+ const { project: i, source: u, target: o } = await b({
1628
+ sourceXml: c.sourceXml,
1629
+ targetXml: c.targetXml,
1630
+ dialecteConfig: A,
1631
+ extensions: r,
1632
+ hooks: B
1633
1633
  });
1634
1634
  try {
1635
- crypto.randomUUID = X();
1636
- const o = await t({
1637
- testCase: _,
1638
- project: c,
1639
- source: n.document,
1640
- target: u?.document
1641
- }), q = o?.assertOn ?? "source", S = o?.withDatabaseIds ?? !0, f = q === "target" ? u?.documentId : n.documentId;
1642
- if (!f) throw new Error("documentId required for export");
1643
- const { xmlDocument: h } = await c.export(f, { withDatabaseIds: S });
1644
- _.expectedQueries?.length && C({ xmlDocument: h, queries: _.expectedQueries }), _.unexpectedQueries?.length && A({ xmlDocument: h, queries: _.unexpectedQueries });
1635
+ crypto.randomUUID = q();
1636
+ const f = await t({
1637
+ testCase: c,
1638
+ project: i,
1639
+ source: u.document,
1640
+ target: o?.document
1641
+ }), S = f?.assertOn ?? "source", D = f?.withDatabaseIds ?? !0, h = S === "target" ? o?.documentId : u.documentId;
1642
+ if (!h) throw new Error("documentId required for export");
1643
+ const { xmlDocument: v } = await i.export(h, { withDatabaseIds: D });
1644
+ c.expectedQueries?.length && _({ xmlDocument: v, queries: c.expectedQueries }), c.unexpectedQueries?.length && C({ xmlDocument: v, queries: c.unexpectedQueries });
1645
1645
  } finally {
1646
- await c.destroy();
1646
+ await i.destroy();
1647
1647
  }
1648
1648
  });
1649
1649
  }
1650
- function J(B) {
1650
+ function ee(a) {
1651
1651
  const {
1652
1652
  testCases: e,
1653
1653
  act: t,
1654
- hooks: r,
1655
- dialecteConfig: a = l
1656
- } = B;
1657
- for (const [C, A] of Object.entries(e))
1658
- (A.only ? p.only : p)(C, async () => {
1659
- crypto.randomUUID = b;
1660
- const { project: _, source: i, target: c } = await E({
1661
- sourceXml: A.sourceXml,
1662
- targetXml: A.targetXml,
1663
- dialecteConfig: a,
1664
- hooks: r
1654
+ extensions: r,
1655
+ hooks: B,
1656
+ dialecteConfig: A = l
1657
+ } = a;
1658
+ for (const [_, C] of Object.entries(e))
1659
+ (C.only ? p.only : p)(_, async () => {
1660
+ crypto.randomUUID = X;
1661
+ const { project: c, source: n, target: i } = await b({
1662
+ sourceXml: C.sourceXml,
1663
+ targetXml: C.targetXml,
1664
+ dialecteConfig: A,
1665
+ extensions: r,
1666
+ hooks: B
1665
1667
  });
1666
1668
  try {
1667
- crypto.randomUUID = X(), await t({ testCase: A, project: _, source: i.document, target: c?.document });
1669
+ crypto.randomUUID = q(), await t({ testCase: C, project: c, source: n.document, target: i?.document });
1668
1670
  } finally {
1669
- await _.destroy();
1671
+ await c.destroy();
1670
1672
  }
1671
1673
  });
1672
1674
  }
1673
- function ee(B, e) {
1674
- for (const [t, r] of Object.entries(B))
1675
+ function te(a, e) {
1676
+ for (const [t, r] of Object.entries(a))
1675
1677
  (r.only ? p.only : p)(t, () => e(r));
1676
1678
  }
1677
- const ie = te(l);
1678
- function te(B, e) {
1679
+ const ne = ae({ dialecteConfig: l });
1680
+ function ae(a) {
1681
+ const { dialecteConfig: e, hooks: t, extensions: r } = a;
1679
1682
  return {
1680
- withExport: (t) => Z({ dialecteConfig: B, hooks: e, ...t }),
1681
- withoutExport: (t) => J({ dialecteConfig: B, hooks: e, ...t }),
1682
- generic: ee
1683
+ withExport: (B) => J({ dialecteConfig: e, extensions: r, hooks: t, ...B }),
1684
+ withoutExport: (B) => ee({ dialecteConfig: e, extensions: r, hooks: t, ...B }),
1685
+ generic: te
1683
1686
  };
1684
1687
  }
1685
- function Be(B) {
1688
+ function Be(a) {
1686
1689
  function e(t) {
1687
- const { record: r, type: a = "raw" } = t, C = g({ record: r, dialecteConfig: B });
1688
- switch (a) {
1690
+ const { record: r, type: B = "raw" } = t, A = O({ record: r, dialecteConfig: a });
1691
+ switch (B) {
1689
1692
  case "raw":
1690
- return C;
1693
+ return A;
1691
1694
  case "tracked":
1692
- return M({ record: C });
1695
+ return k({ record: A });
1693
1696
  case "tree":
1694
- return O({ record: C });
1697
+ return M({ record: A });
1695
1698
  default:
1696
- throw new Error(`Unsupported record type: ${a}`);
1699
+ throw new Error(`Unsupported record type: ${B}`);
1697
1700
  }
1698
1701
  }
1699
1702
  return e;
1700
1703
  }
1701
- const ne = Be(l);
1704
+ const ue = Be(l);
1702
1705
  export {
1703
- W as DATABASE_CONFIG,
1706
+ Z as DATABASE_CONFIG,
1704
1707
  d as DIALECTE_NAMESPACES,
1705
- K as IO_CONFIG,
1708
+ W as IO_CONFIG,
1706
1709
  l as TEST_DIALECTE_CONFIG,
1707
- Ce as XMLNS_DEFAULT_NAMESPACE,
1708
- _e as XMLNS_DEV_NAMESPACE,
1709
- se as XMLNS_EXT_NAMESPACE,
1710
- V as assertExpectedElementQueries,
1711
- y as assertUnexpectedElementQueries,
1712
- X as createMockRandomUUID,
1713
- ce as createTestContext,
1714
- E as createTestProject,
1715
- ne as createTestRecord,
1710
+ _e as XMLNS_DEFAULT_NAMESPACE,
1711
+ se as XMLNS_DEV_NAMESPACE,
1712
+ ce as XMLNS_EXT_NAMESPACE,
1713
+ F as assertExpectedElementQueries,
1714
+ I as assertUnexpectedElementQueries,
1715
+ q as createMockRandomUUID,
1716
+ ie as createTestContext,
1717
+ b as createTestProject,
1718
+ ue as createTestRecord,
1716
1719
  Be as createTestRecordFactory,
1717
- te as createTestRunner,
1718
- R as createXmlAssertions,
1719
- ie as runTestCases,
1720
- v as splitXpathIntoSteps
1720
+ ae as createTestRunner,
1721
+ V as createXmlAssertions,
1722
+ ne as runTestCases,
1723
+ E as splitXpathIntoSteps
1721
1724
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialecte/core",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Dialecte - Core functionality for Dialecte SDK",
5
5
  "license": "MIT",
6
6
  "repository": {