@graphty/graph-io 0.3.18 → 0.3.19

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.
Files changed (118) hide show
  1. package/README.md +37 -2
  2. package/dist/chunks/{escape-D-gZWO26.js → escape-CWExcecC.js} +3 -3
  3. package/dist/chunks/{escape-D-gZWO26.js.map → escape-CWExcecC.js.map} +1 -1
  4. package/dist/chunks/exporter-CbMZyVt-.js +735 -0
  5. package/dist/chunks/exporter-CbMZyVt-.js.map +1 -0
  6. package/dist/chunks/importer-BAP4PrxR.js +2194 -0
  7. package/dist/chunks/importer-BAP4PrxR.js.map +1 -0
  8. package/dist/chunks/{importer-Br_QeAeE.js → importer-BNFuV1-K.js} +5 -4
  9. package/dist/chunks/{importer-Br_QeAeE.js.map → importer-BNFuV1-K.js.map} +1 -1
  10. package/dist/chunks/{importer-d0uQxFp6.js → importer-BVGtU1NA.js} +5 -4
  11. package/dist/chunks/{importer-d0uQxFp6.js.map → importer-BVGtU1NA.js.map} +1 -1
  12. package/dist/chunks/{importer-DHagxvDD.js → importer-BW-Ft2ps.js} +5 -4
  13. package/dist/chunks/{importer-DHagxvDD.js.map → importer-BW-Ft2ps.js.map} +1 -1
  14. package/dist/chunks/{importer-Du5crN9l.js → importer-Bm1_5vPS.js} +275 -82
  15. package/dist/chunks/importer-Bm1_5vPS.js.map +1 -0
  16. package/dist/chunks/{importer-aNJfe0qu.js → importer-ByPGO-09.js} +2 -2
  17. package/dist/chunks/{importer-aNJfe0qu.js.map → importer-ByPGO-09.js.map} +1 -1
  18. package/dist/chunks/importer-DOepkgnG.js +1713 -0
  19. package/dist/chunks/importer-DOepkgnG.js.map +1 -0
  20. package/dist/chunks/json-elements-CZY1wiZh.js +779 -0
  21. package/dist/chunks/json-elements-CZY1wiZh.js.map +1 -0
  22. package/dist/chunks/{records-Bk9jgodz.js → records-BzNicMsf.js} +2 -2
  23. package/dist/chunks/{records-Bk9jgodz.js.map → records-BzNicMsf.js.map} +1 -1
  24. package/dist/chunks/{report-BOk0p5y8.js → report-BcWboivV.js} +95 -95
  25. package/dist/chunks/{report-BOk0p5y8.js.map → report-BcWboivV.js.map} +1 -1
  26. package/dist/chunks/weights-CwISIpCP.js +176 -0
  27. package/dist/chunks/weights-CwISIpCP.js.map +1 -0
  28. package/dist/chunks/{writer-GAdltGmC.js → writer-DQiKgQJc.js} +8 -179
  29. package/dist/chunks/writer-DQiKgQJc.js.map +1 -0
  30. package/dist/csv.js +5 -4
  31. package/dist/csv.js.map +1 -1
  32. package/dist/cx.d.ts +1 -0
  33. package/dist/cx.js +6 -0
  34. package/dist/cx.js.map +1 -0
  35. package/dist/cx2.d.ts +1 -0
  36. package/dist/cx2.js +10 -0
  37. package/dist/cx2.js.map +1 -0
  38. package/dist/dot.js +1 -1
  39. package/dist/gexf.js +15 -4
  40. package/dist/gexf.js.map +1 -1
  41. package/dist/gml.js +5 -4
  42. package/dist/gml.js.map +1 -1
  43. package/dist/graph-io.js +145 -389
  44. package/dist/graph-io.js.map +1 -1
  45. package/dist/graphml.js +1 -1
  46. package/dist/json.js +1 -1
  47. package/dist/neo4j.js +5 -4
  48. package/dist/neo4j.js.map +1 -1
  49. package/dist/obo.js +1 -1
  50. package/dist/pajek.js +1 -1
  51. package/dist/src/common/json-elements.d.ts +286 -0
  52. package/dist/src/common/json-elements.d.ts.map +1 -0
  53. package/dist/src/common/json-elements.js +926 -0
  54. package/dist/src/common/json-elements.js.map +1 -0
  55. package/dist/src/formats/cx/importer.d.ts +133 -0
  56. package/dist/src/formats/cx/importer.d.ts.map +1 -0
  57. package/dist/src/formats/cx/importer.js +2220 -0
  58. package/dist/src/formats/cx/importer.js.map +1 -0
  59. package/dist/src/formats/cx/index.d.ts +7 -0
  60. package/dist/src/formats/cx/index.d.ts.map +1 -0
  61. package/dist/src/formats/cx/index.js +7 -0
  62. package/dist/src/formats/cx/index.js.map +1 -0
  63. package/dist/src/formats/cx2/exporter.d.ts +59 -0
  64. package/dist/src/formats/cx2/exporter.d.ts.map +1 -0
  65. package/dist/src/formats/cx2/exporter.js +864 -0
  66. package/dist/src/formats/cx2/exporter.js.map +1 -0
  67. package/dist/src/formats/cx2/importer.d.ts +169 -0
  68. package/dist/src/formats/cx2/importer.d.ts.map +1 -0
  69. package/dist/src/formats/cx2/importer.js +1652 -0
  70. package/dist/src/formats/cx2/importer.js.map +1 -0
  71. package/dist/src/formats/cx2/index.d.ts +7 -0
  72. package/dist/src/formats/cx2/index.d.ts.map +1 -0
  73. package/dist/src/formats/cx2/index.js +7 -0
  74. package/dist/src/formats/cx2/index.js.map +1 -0
  75. package/dist/src/formats/gexf/exporter.d.ts +2 -0
  76. package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
  77. package/dist/src/formats/gexf/exporter.js +6 -0
  78. package/dist/src/formats/gexf/exporter.js.map +1 -1
  79. package/dist/src/formats/gexf/importer.d.ts +2 -4
  80. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  81. package/dist/src/formats/gexf/importer.js +2 -4
  82. package/dist/src/formats/gexf/importer.js.map +1 -1
  83. package/dist/src/formats/gexf/index.d.ts +1 -1
  84. package/dist/src/formats/gexf/index.js +2 -2
  85. package/dist/src/formats/gexf/index.js.map +1 -1
  86. package/dist/src/formats/gml/exporter.js +1 -1
  87. package/dist/src/formats/gml/exporter.js.map +1 -1
  88. package/dist/src/formats/json/importer.d.ts.map +1 -1
  89. package/dist/src/formats/json/importer.js +6 -104
  90. package/dist/src/formats/json/importer.js.map +1 -1
  91. package/dist/src/index.d.ts +2 -0
  92. package/dist/src/index.d.ts.map +1 -1
  93. package/dist/src/index.js +2 -0
  94. package/dist/src/index.js.map +1 -1
  95. package/dist/src/registry.d.ts.map +1 -1
  96. package/dist/src/registry.js +5 -0
  97. package/dist/src/registry.js.map +1 -1
  98. package/dist/src/sniff.d.ts +1 -1
  99. package/dist/src/sniff.d.ts.map +1 -1
  100. package/dist/src/sniff.js +2 -0
  101. package/dist/src/sniff.js.map +1 -1
  102. package/package.json +11 -1
  103. package/src/common/json-elements.ts +1147 -0
  104. package/src/formats/cx/importer.ts +2733 -0
  105. package/src/formats/cx/index.ts +7 -0
  106. package/src/formats/cx2/exporter.ts +1036 -0
  107. package/src/formats/cx2/importer.ts +2187 -0
  108. package/src/formats/cx2/index.ts +7 -0
  109. package/src/formats/gexf/exporter.ts +11 -0
  110. package/src/formats/gexf/importer.ts +2 -2
  111. package/src/formats/gexf/index.ts +1 -1
  112. package/src/formats/gml/exporter.ts +1 -1
  113. package/src/formats/json/importer.ts +6 -105
  114. package/src/index.ts +10 -0
  115. package/src/registry.ts +5 -0
  116. package/src/sniff.ts +14 -1
  117. package/dist/chunks/importer-Du5crN9l.js.map +0 -1
  118. package/dist/chunks/writer-GAdltGmC.js.map +0 -1
package/dist/graph-io.js CHANGED
@@ -1,286 +1,35 @@
1
- import { I as ImportReportBuilder, a as throwIfAborted } from "./chunks/report-BOk0p5y8.js";
2
- import { A, b, B, c, d, e, C, f, g, h, D, i, j, k, l, m, n, o, p, q, E, r, s, u, G, H, v, w, x, y, z, F, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, t } from "./chunks/report-BOk0p5y8.js";
3
- import { C as C2, c as c2, a } from "./chunks/children-CL3Cy0ez.js";
1
+ import { I as ImportReportBuilder, t as throwIfAborted } from "./chunks/report-BcWboivV.js";
2
+ import { A, a, B, b, c, d, C, e, f, g, D, h, i, j, k, l, m, n, o, p, E, q, r, s, G, H, u, v, w, x, y, z, F, J, L, M, K, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD } from "./chunks/report-BcWboivV.js";
3
+ import { C as C2, c as c2, a as a10 } from "./chunks/children-CL3Cy0ez.js";
4
4
  import { GraphFormatError, GraphBuilder } from "@graphty/graph-format";
5
5
  import { csvImporter, csvExporter } from "./csv.js";
6
6
  import { CSV_CAPABILITIES, CSV_ISSUE, CSV_LOSS } from "./csv.js";
7
- import { b as dotImporter, d as dotExporter } from "./chunks/importer-Br_QeAeE.js";
8
- import { D as D2, a as a10 } from "./chunks/importer-Br_QeAeE.js";
7
+ import { c as cxImporter } from "./chunks/importer-BAP4PrxR.js";
8
+ import { C as C3 } from "./chunks/importer-BAP4PrxR.js";
9
+ import { c as cx2Exporter } from "./chunks/exporter-CbMZyVt-.js";
10
+ import { C as C4, a as a11 } from "./chunks/exporter-CbMZyVt-.js";
11
+ import { c as cx2Importer } from "./chunks/importer-DOepkgnG.js";
12
+ import { C as C5 } from "./chunks/importer-DOepkgnG.js";
13
+ import { b as dotImporter, d as dotExporter } from "./chunks/importer-BNFuV1-K.js";
14
+ import { D as D2, a as a12 } from "./chunks/importer-BNFuV1-K.js";
9
15
  import { gexfImporter, gexfExporter } from "./gexf.js";
10
16
  import { GEXF_1_2_CAPABILITIES, GEXF_ISSUE, GEXF_LOSS } from "./gexf.js";
11
17
  import { gmlImporter, gmlExporter } from "./gml.js";
12
18
  import { GML_ISSUE, GML_LOSS } from "./gml.js";
13
- import { b as graphmlImporter, g as graphmlExporter } from "./chunks/importer-DHagxvDD.js";
14
- import { G as G2, a as a11 } from "./chunks/importer-DHagxvDD.js";
15
- import { s as sniffJsonDialect, e as jsonImporter, c as jsonExporter } from "./chunks/importer-Du5crN9l.js";
16
- import { J as J2, a as a12, b as b2, d as d2, j as j2 } from "./chunks/importer-Du5crN9l.js";
19
+ import { b as graphmlImporter, g as graphmlExporter } from "./chunks/importer-BW-Ft2ps.js";
20
+ import { G as G2, a as a13 } from "./chunks/importer-BW-Ft2ps.js";
21
+ import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/importer-Bm1_5vPS.js";
22
+ import { G as G3, J as J2, a as a14, b as b2, d as d2, f as f2, h as h2, j as j2, n as n2, s as s2, g as g2 } from "./chunks/importer-Bm1_5vPS.js";
17
23
  import { neo4jImporter, neo4jExporter } from "./neo4j.js";
18
24
  import { ID_SPACE_COLUMN, LABELS_COLUMN, NEO4J_CAPABILITIES, NEO4J_ISSUE, NEO4J_LOSS, ORIGINAL_ID_COLUMN, TYPE_COLUMN } from "./neo4j.js";
19
- import { o as oboImporter } from "./chunks/importer-aNJfe0qu.js";
20
- import { O as O2 } from "./chunks/importer-aNJfe0qu.js";
21
- import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-d0uQxFp6.js";
22
- import { P as P2, a as a13 } from "./chunks/importer-d0uQxFp6.js";
23
- import { D as D3, L as L2, N as N2, c as c3, a as a14, b as b3, d as d3, e as e2, f as f2, g as g2, h as h2, i as i2, j as j3, k as k2, l as l2, m as m2, n as n2, o as o2, p as p2, s as s2, t as t2 } from "./chunks/writer-GAdltGmC.js";
24
- import { T as T2, W as W2, i as i3, a as a15, p as p3 } from "./chunks/text-Dr0Ifpag.js";
25
- import { X as X2, a as a16, h as h3, t as t3, x as x2 } from "./chunks/escape-D-gZWO26.js";
26
- const GRAPH_FORMATS = Object.freeze([
27
- "json",
28
- "graphml",
29
- "gexf",
30
- "csv",
31
- "gml",
32
- "dot",
33
- "pajek",
34
- "neo4j",
35
- "obo"
36
- ]);
37
- const SNIFF_HEAD_BYTES = 8192;
38
- function extensionOf(filename) {
39
- const base = filename.slice(Math.max(filename.lastIndexOf("/"), filename.lastIndexOf("\\")) + 1);
40
- const dot = base.lastIndexOf(".");
41
- if (dot <= 0 || dot === base.length - 1) {
42
- return null;
43
- }
44
- return base.slice(dot).toLowerCase();
45
- }
46
- function normalizeMimeType(mimeType) {
47
- const semicolon = mimeType.indexOf(";");
48
- return (semicolon < 0 ? mimeType : mimeType.slice(0, semicolon)).trim().toLowerCase();
49
- }
50
- function headBytes(head) {
51
- if (typeof head === "string") {
52
- return new TextEncoder().encode(head.slice(0, SNIFF_HEAD_BYTES)).subarray(0, SNIFF_HEAD_BYTES);
53
- }
54
- if (head.byteLength >= 2 && (head[0] === 255 && head[1] === 254 || head[0] === 254 && head[1] === 255)) {
55
- const encoding = head[0] === 255 ? "utf-16le" : "utf-16be";
56
- return headBytes(new TextDecoder(encoding).decode(head.subarray(0, SNIFF_HEAD_BYTES)));
57
- }
58
- return head.byteLength > SNIFF_HEAD_BYTES ? head.subarray(0, SNIFF_HEAD_BYTES) : head;
59
- }
60
- function rankFormats(hints, importers) {
61
- const extension = typeof hints.filename === "string" ? extensionOf(hints.filename) : null;
62
- const mime = typeof hints.mimeType === "string" ? normalizeMimeType(hints.mimeType) : null;
63
- const head = hints.head === void 0 || hints.head === null ? null : headBytes(hints.head);
64
- const candidates = [];
65
- let rank = 0;
66
- for (const importer of importers) {
67
- const extensionMatch = extension !== null && importer.extensions.some((e3) => e3.toLowerCase() === extension);
68
- const mimeMatch = mime !== null && importer.mimeTypes.some((m3) => m3.toLowerCase() === mime);
69
- let content = 0;
70
- if (head !== null && head.byteLength > 0 && typeof importer.sniff === "function") {
71
- content = clamp(importer.sniff(head));
72
- }
73
- let confidence;
74
- if (content > 0) {
75
- confidence = 0.5 + 0.35 * content + (extensionMatch ? 0.1 : 0) + (mimeMatch ? 0.05 : 0);
76
- } else if (extensionMatch || mimeMatch) {
77
- confidence = (extensionMatch ? 0.3 : 0) + (mimeMatch ? 0.1 : 0);
78
- } else {
79
- continue;
80
- }
81
- const dialect = importer.format === "json" && head !== null ? sniffJsonDialectHead(head) : null;
82
- const result2 = Object.freeze({
83
- format: importer.format,
84
- confidence: Math.min(1, confidence),
85
- content,
86
- extension: extensionMatch,
87
- mimeType: mimeMatch,
88
- dialect
89
- });
90
- candidates.push({ result: result2, rank: rank++ });
91
- }
92
- candidates.sort((a17, b4) => b4.result.confidence - a17.result.confidence || a17.rank - b4.rank);
93
- return candidates.map((c4) => c4.result);
94
- }
95
- function sniffFormat(hints, importers) {
96
- const ranked = rankFormats(hints, importers);
97
- return ranked.length > 0 ? ranked[0] : null;
98
- }
99
- function sniffJsonDialectHead(head) {
100
- const text = typeof head === "string" ? head : new TextDecoder("utf-8", { fatal: false }).decode(head);
101
- const body = text.charCodeAt(0) === 65279 ? text.slice(1) : text;
102
- const trimmed = body.trimStart();
103
- if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
104
- return null;
105
- }
106
- let root;
107
- try {
108
- root = JSON.parse(trimmed);
109
- } catch {
110
- root = skeletonOf(trimmed);
111
- }
112
- return sniffJsonDialect(root);
113
- }
114
- function skeletonOf(text) {
115
- const keys = scanKeys(text);
116
- if (text.startsWith("[")) {
117
- const first = keys.get("nodes[0]");
118
- return first === void 0 ? null : [objectOf(first)];
119
- }
120
- const rootKeys = keys.get("");
121
- if (rootKeys === void 0) {
122
- return null;
123
- }
124
- const root = {};
125
- for (const key of rootKeys) {
126
- switch (key) {
127
- case "graph":
128
- case "options":
129
- root[key] = objectOf(keys.get(key));
130
- break;
131
- case "graphs": {
132
- const nodes = keys.get("graphs[0].nodes[]");
133
- const edges = keys.get("graphs[0].edges[]");
134
- const graph = {};
135
- if (nodes !== void 0) {
136
- graph.nodes = [objectOf(nodes)];
137
- }
138
- if (edges !== void 0) {
139
- graph.edges = [objectOf(edges)];
140
- }
141
- root[key] = nodes === void 0 && edges === void 0 ? [] : [graph];
142
- break;
143
- }
144
- case "nodes":
145
- case "edges":
146
- case "links": {
147
- const first = keys.get(`${key}[0]`);
148
- root[key] = first === void 0 ? [] : [objectOf(first)];
149
- break;
150
- }
151
- default:
152
- root[key] = true;
153
- break;
154
- }
155
- }
156
- return root;
157
- }
158
- function objectOf(names) {
159
- const out = {};
160
- if (names !== void 0) {
161
- for (const name of names) {
162
- out[name] = name === "attributes" || name === "data" ? {} : true;
163
- }
164
- }
165
- return out;
166
- }
167
- function scanKeys(text) {
168
- const found = /* @__PURE__ */ new Map();
169
- const kinds = [];
170
- const labels = [];
171
- const counts = [];
172
- let pendingKey = null;
173
- let expectingKey = false;
174
- const pathOf = () => {
175
- const depth = kinds.length;
176
- if (depth === 1) {
177
- return kinds[0] === "object" ? "" : null;
178
- }
179
- if (depth === 2 && kinds[0] === "array" && kinds[1] === "object" && labels[1] === "0") {
180
- return "nodes[0]";
181
- }
182
- if (depth === 2 && kinds[0] === "object" && kinds[1] === "object") {
183
- return labels[1] === "graph" || labels[1] === "options" ? labels[1] : null;
184
- }
185
- if (depth === 5 && kinds.join() === "object,array,object,array,object" && labels[1] === "graphs" && labels[2] === "0" && (labels[3] === "nodes" || labels[3] === "edges")) {
186
- return labels[3] === "nodes" ? "graphs[0].nodes[]" : "graphs[0].edges[]";
187
- }
188
- if (depth === 3 && kinds[0] === "object" && kinds[1] === "array" && kinds[2] === "object") {
189
- const section = labels[1];
190
- if ((section === "nodes" || section === "edges" || section === "links") && labels[2] === "0") {
191
- return `${section}[0]`;
192
- }
193
- }
194
- return null;
195
- };
196
- let i4 = 0;
197
- const n3 = text.length;
198
- while (i4 < n3) {
199
- const ch = text[i4];
200
- if (ch === '"') {
201
- const end = scanString(text, i4 + 1);
202
- if (end < 0) {
203
- break;
204
- }
205
- const literal = text.slice(i4 + 1, end);
206
- i4 = end + 1;
207
- if (expectingKey) {
208
- pendingKey = decodeKey(literal);
209
- expectingKey = false;
210
- }
211
- continue;
212
- }
213
- if (ch === "{" || ch === "[") {
214
- let label = "";
215
- if (kinds.length > 0) {
216
- label = kinds[kinds.length - 1] === "object" ? pendingKey ?? "" : String(counts[counts.length - 1]);
217
- }
218
- kinds.push(ch === "{" ? "object" : "array");
219
- labels.push(label);
220
- counts.push(0);
221
- expectingKey = ch === "{";
222
- pendingKey = null;
223
- } else if (ch === "}" || ch === "]") {
224
- kinds.pop();
225
- labels.pop();
226
- counts.pop();
227
- expectingKey = false;
228
- pendingKey = null;
229
- } else if (ch === ":") {
230
- if (pendingKey !== null) {
231
- const path = pathOf();
232
- if (path !== null) {
233
- let set = found.get(path);
234
- if (set === void 0) {
235
- set = /* @__PURE__ */ new Set();
236
- found.set(path, set);
237
- }
238
- set.add(pendingKey);
239
- }
240
- }
241
- } else if (ch === ",") {
242
- const top = kinds.length - 1;
243
- if (top >= 0) {
244
- counts[top]++;
245
- expectingKey = kinds[top] === "object";
246
- }
247
- pendingKey = null;
248
- }
249
- i4++;
250
- }
251
- return found;
252
- }
253
- function scanString(text, from) {
254
- let i4 = from;
255
- while (i4 < text.length) {
256
- const ch = text[i4];
257
- if (ch === "\\") {
258
- i4 += 2;
259
- continue;
260
- }
261
- if (ch === '"') {
262
- return i4;
263
- }
264
- i4++;
265
- }
266
- return -1;
267
- }
268
- function decodeKey(literal) {
269
- if (!literal.includes("\\")) {
270
- return literal;
271
- }
272
- try {
273
- return JSON.parse(`"${literal}"`);
274
- } catch {
275
- return literal;
276
- }
277
- }
278
- function clamp(value) {
279
- if (!(value > 0)) {
280
- return 0;
281
- }
282
- return value > 1 ? 1 : value;
283
- }
25
+ import { o as oboImporter } from "./chunks/importer-ByPGO-09.js";
26
+ import { O as O2 } from "./chunks/importer-ByPGO-09.js";
27
+ import { b as pajekImporter, p as pajekExporter } from "./chunks/importer-BVGtU1NA.js";
28
+ import { P as P2, a as a15 } from "./chunks/importer-BVGtU1NA.js";
29
+ import { D as D3, L as L2, N as N2, c as c3, a as a16, b as b3, d as d3, e as e2, i as i2, j as j3, m as m2, s as s3, t } from "./chunks/writer-DQiKgQJc.js";
30
+ import { e as e3, f as f3, a as a17, b as b4, c as c4, d as d4, i as i3, p as p2 } from "./chunks/weights-CwISIpCP.js";
31
+ import { T as T2, W as W2, i as i4, a as a18, p as p3 } from "./chunks/text-Dr0Ifpag.js";
32
+ import { X as X2, a as a19, h as h3, t as t2, x as x2 } from "./chunks/escape-CWExcecC.js";
284
33
  const UNKNOWN_FORMAT_CODE = "E_UNKNOWN_FORMAT";
285
34
  const REGISTRY_KEYS = /* @__PURE__ */ new Set(["format", "filename", "mimeType", "builder", "freeze"]);
286
35
  class FormatRegistry {
@@ -442,7 +191,7 @@ class FormatRegistry {
442
191
  await chosen.peeked?.close();
443
192
  throw err;
444
193
  }
445
- return reports.map((report, i4) => result(chosen, builders[i4], report, options));
194
+ return reports.map((report, i5) => result(chosen, builders[i5], report, options));
446
195
  }
447
196
  /**
448
197
  * The graphs of an input that can hold several, without importing them (a Cytoscape session's
@@ -517,7 +266,7 @@ class FormatRegistry {
517
266
  }
518
267
  }
519
268
  function createRegistry() {
520
- return new FormatRegistry().registerImporter(jsonImporter).registerExporter(jsonExporter).registerImporter(graphmlImporter).registerExporter(graphmlExporter).registerImporter(gexfImporter).registerExporter(gexfExporter).registerImporter(csvImporter).registerExporter(csvExporter).registerImporter(gmlImporter).registerExporter(gmlExporter).registerImporter(dotImporter).registerExporter(dotExporter).registerImporter(pajekImporter).registerExporter(pajekExporter).registerImporter(neo4jImporter).registerExporter(neo4jExporter).registerImporter(oboImporter);
269
+ return new FormatRegistry().registerImporter(jsonImporter).registerExporter(jsonExporter).registerImporter(graphmlImporter).registerExporter(graphmlExporter).registerImporter(gexfImporter).registerExporter(gexfExporter).registerImporter(csvImporter).registerExporter(csvExporter).registerImporter(gmlImporter).registerExporter(gmlExporter).registerImporter(dotImporter).registerExporter(dotExporter).registerImporter(pajekImporter).registerExporter(pajekExporter).registerImporter(neo4jImporter).registerExporter(neo4jExporter).registerImporter(cx2Importer).registerExporter(cx2Exporter).registerImporter(cxImporter).registerImporter(oboImporter);
521
270
  }
522
271
  const registry = createRegistry();
523
272
  function importGraph(input, options) {
@@ -621,10 +370,10 @@ async function peekHead(input, bytes, signal) {
621
370
  return { head: joinHead(buffered, bytes), input: replayed, close: () => replayed.close() };
622
371
  }
623
372
  function joinHead(chunks, bytes) {
624
- if (chunks.every((c4) => c4 instanceof Uint8Array)) {
373
+ if (chunks.every((c5) => c5 instanceof Uint8Array)) {
625
374
  const total = Math.min(
626
375
  bytes,
627
- chunks.reduce((sum, c4) => sum + c4.byteLength, 0)
376
+ chunks.reduce((sum, c5) => sum + c5.byteLength, 0)
628
377
  );
629
378
  const head = new Uint8Array(total);
630
379
  let offset = 0;
@@ -711,36 +460,40 @@ function readerIterator(stream) {
711
460
  }
712
461
  export {
713
462
  A as AMBIGUOUS_GRAPH_NAME_CODE,
714
- b as ASPECT_ORDER_CODE,
463
+ a as ASPECT_ORDER_CODE,
715
464
  B as BAD_ASPECT_BLOCK_CODE,
716
- c as BAD_DEFAULT_CODE,
717
- d as BAD_OPTIONS_CODE,
718
- e as BAD_VALUE_CODE,
465
+ b as BAD_DEFAULT_CODE,
466
+ c as BAD_OPTIONS_CODE,
467
+ d as BAD_VALUE_CODE,
719
468
  C as COLUMN_RENAMED_CODE,
720
- f as COLUMN_RENAMED_LOSS_CODE,
721
- g as COUNT_HINT_CODE,
722
- h as COUNT_MISMATCH_CODE,
469
+ e as COLUMN_RENAMED_LOSS_CODE,
470
+ f as COUNT_HINT_CODE,
471
+ g as COUNT_MISMATCH_CODE,
723
472
  CSV_CAPABILITIES,
724
473
  CSV_ISSUE,
725
474
  CSV_LOSS,
475
+ C4 as CX2_CAPABILITIES,
476
+ C5 as CX2_ISSUE,
477
+ a11 as CX2_LOSS,
478
+ C3 as CX_ISSUE,
726
479
  C2 as ChildrenCsr,
727
480
  D as DANGLING_REFERENCE_CODE,
728
481
  D3 as DEFAULT_CHUNK_BYTES,
729
- i as DEFAULT_ERROR_LIMIT,
730
- j as DIRECTED_COLUMN,
731
- k as DIRECTION_FORCED_CODE,
732
- l as DIRECTION_REFUSED_CODE,
482
+ h as DEFAULT_ERROR_LIMIT,
483
+ i as DIRECTED_COLUMN,
484
+ j as DIRECTION_FORCED_CODE,
485
+ k as DIRECTION_REFUSED_CODE,
733
486
  D2 as DOT_ISSUE,
734
- a10 as DOT_LOSS,
735
- m as DUPLICATE_ATTRIBUTE_CODE,
736
- n as DUPLICATE_EDGE_ID_CODE,
737
- o as DUPLICATE_KEY_CODE,
738
- p as DUPLICATE_NODE_CODE,
739
- q as DirectionResolver,
487
+ a12 as DOT_LOSS,
488
+ l as DUPLICATE_ATTRIBUTE_CODE,
489
+ m as DUPLICATE_EDGE_ID_CODE,
490
+ n as DUPLICATE_KEY_CODE,
491
+ o as DUPLICATE_NODE_CODE,
492
+ p as DirectionResolver,
740
493
  E as EMPTY_COLUMN_DROPPED_CODE,
741
- r as EMPTY_INPUT_CODE,
742
- s as ENCODING_FALLBACK_CODE,
743
- u as EQUATION_AS_TEXT_CODE,
494
+ q as EMPTY_INPUT_CODE,
495
+ r as ENCODING_FALLBACK_CODE,
496
+ s as EQUATION_AS_TEXT_CODE,
744
497
  FormatRegistry,
745
498
  GEXF_1_2_CAPABILITIES,
746
499
  GEXF_ISSUE,
@@ -748,110 +501,113 @@ export {
748
501
  GML_ISSUE,
749
502
  GML_LOSS,
750
503
  G2 as GRAPHML_ISSUE,
751
- a11 as GRAPHML_LOSS,
752
- GRAPH_FORMATS,
504
+ a13 as GRAPHML_LOSS,
505
+ G3 as GRAPH_FORMATS,
753
506
  G as GRAPH_NOT_FOUND_CODE,
754
507
  H as HYPEREDGE_CODE,
755
- v as ID_MERGED_CODE,
508
+ u as ID_MERGED_CODE,
756
509
  ID_SPACE_COLUMN,
757
- w as ID_TEXT_COLLISION_CODE,
758
- x as ID_TEXT_TYPE_CODE,
759
- y as INTEGRAL_F64_CODE,
760
- z as INVALID_ENCODING_CODE,
761
- F as INVALID_UTF8_CODE,
762
- J as IdCoercer,
763
- K as ImportError,
510
+ v as ID_TEXT_COLLISION_CODE,
511
+ w as ID_TEXT_TYPE_CODE,
512
+ x as INTEGRAL_F64_CODE,
513
+ y as INVALID_ENCODING_CODE,
514
+ z as INVALID_UTF8_CODE,
515
+ F as IdCoercer,
516
+ J as ImportError,
764
517
  ImportReportBuilder,
765
518
  J2 as JSON_DIALECTS,
766
- a12 as JSON_ISSUE,
519
+ a14 as JSON_ISSUE,
767
520
  b2 as JSON_LOSS,
768
521
  LABELS_COLUMN,
769
522
  L2 as LOSS,
770
523
  L as LineReader,
771
524
  M as MISSING_ENDPOINT_CODE,
772
- N as MISSING_ID_CODE,
773
- O as MIXED_DIRECTION_CODE,
774
- P as MULTIPLE_GRAPHS_CODE,
775
- Q as MUTUAL_AS_UNDIRECTED_CODE,
776
- R as MUTUAL_COLUMN,
777
- S as MUTUAL_EXPANDED_CODE,
525
+ K as MISSING_ID_CODE,
526
+ N as MIXED_DIRECTION_CODE,
527
+ O as MULTIPLE_GRAPHS_CODE,
528
+ P as MUTUAL_AS_UNDIRECTED_CODE,
529
+ Q as MUTUAL_COLUMN,
530
+ R as MUTUAL_EXPANDED_CODE,
778
531
  NEO4J_CAPABILITIES,
779
532
  NEO4J_ISSUE,
780
533
  NEO4J_LOSS,
781
534
  N2 as NO_CAPABILITIES,
782
- T as NO_GRAPH_CODE,
535
+ S as NO_GRAPH_CODE,
783
536
  O2 as OBO_ISSUE,
784
- U as OPTIONS_GAINED_CODE,
785
- V as OPTION_IGNORED_CODE,
537
+ T as OPTIONS_GAINED_CODE,
538
+ U as OPTION_IGNORED_CODE,
786
539
  ORIGINAL_ID_COLUMN,
787
- W as PAIR_COLUMN,
540
+ V as PAIR_COLUMN,
788
541
  P2 as PAJEK_ISSUE,
789
- a13 as PAJEK_LOSS,
790
- X as PARENTS_DROPPED_CODE,
791
- Y as PARENT_CYCLE_CODE,
792
- Z as PARSE_ERROR_CODE,
793
- _ as PRECISION_CODE,
794
- $ as RENAMED_CODE,
795
- a0 as ROLE_ASSUMED_CODE,
796
- a1 as ROLE_DROPPED_CODE,
797
- a2 as ROLE_TAKEN_CODE,
798
- a3 as SINK_OPTION_CODE,
542
+ a15 as PAJEK_LOSS,
543
+ W as PARENTS_DROPPED_CODE,
544
+ X as PARENT_CYCLE_CODE,
545
+ Y as PARSE_ERROR_CODE,
546
+ Z as PRECISION_CODE,
547
+ _ as RENAMED_CODE,
548
+ $ as ROLE_ASSUMED_CODE,
549
+ a0 as ROLE_DROPPED_CODE,
550
+ a1 as ROLE_TAKEN_CODE,
551
+ a2 as SINK_OPTION_CODE,
799
552
  SNIFF_HEAD_BYTES,
800
- a4 as STATUS_FAILED_CODE,
801
- a5 as STATUS_WARNING_CODE,
802
- a6 as STORAGE_CLASS_CODE,
803
- a7 as STRAY_TEXT_CODE,
804
- a8 as STYLES_NOT_IMPORTED_CODE,
805
- a9 as SYNTAX_CODE,
806
- aa as TEMPORAL_DROPPED_CODE,
807
- ab as TEMPORAL_TEXT_DROPPED_CODE,
808
- ac as TEXT_INFERRED_CODE,
809
- ad as TOO_LARGE_CODE,
553
+ a3 as STATUS_FAILED_CODE,
554
+ a4 as STATUS_WARNING_CODE,
555
+ a5 as STORAGE_CLASS_CODE,
556
+ a6 as STRAY_TEXT_CODE,
557
+ a7 as STYLES_NOT_IMPORTED_CODE,
558
+ a8 as SYNTAX_CODE,
559
+ a9 as TEMPORAL_DROPPED_CODE,
560
+ aa as TEMPORAL_TEXT_DROPPED_CODE,
561
+ ab as TEXT_INFERRED_CODE,
562
+ ac as TOO_LARGE_CODE,
810
563
  TYPE_COLUMN,
811
564
  T2 as TextCellWriter,
812
- ae as UNKNOWN_ATTR_TYPE_CODE,
813
- af as UNKNOWN_ELEMENT_CODE,
814
- ag as UNKNOWN_ENCODING_CODE,
565
+ ad as UNKNOWN_ATTR_TYPE_CODE,
566
+ ae as UNKNOWN_ELEMENT_CODE,
567
+ af as UNKNOWN_ENCODING_CODE,
815
568
  UNKNOWN_FORMAT_CODE,
816
- ah as UNKNOWN_PARENT_CODE,
817
- ai as UNKNOWN_TYPE_CODE,
818
- aj as WEIGHT_KEY_CLASH_CODE,
819
- ak as WIDENED_CODE,
569
+ ag as UNKNOWN_PARENT_CODE,
570
+ ah as UNKNOWN_TYPE_CODE,
571
+ ai as WEIGHT_KEY_CLASH_CODE,
572
+ aj as WIDENED_CODE,
820
573
  W2 as WIDENING_UNSUPPORTED_CODE,
821
- al as XML_ILLEGAL_CHAR_CODE,
822
- am as XML_SYNTAX_CODE,
574
+ ak as XML_ILLEGAL_CHAR_CODE,
575
+ al as XML_SYNTAX_CODE,
823
576
  X2 as XmlSyntaxError,
824
- a16 as XmlTokenizer,
825
- an as canonicalId,
577
+ a19 as XmlTokenizer,
578
+ am as canonicalId,
826
579
  c3 as capabilities,
827
- a14 as checkCapabilities,
580
+ a16 as checkCapabilities,
828
581
  checkExport,
829
582
  c2 as childrenCsr,
830
- a as childrenFromColumn,
831
- ao as chooseGraph,
832
- ap as coerceId,
833
- aq as coerceIdText,
583
+ a10 as childrenFromColumn,
584
+ an as chooseGraph,
585
+ ao as coerceId,
586
+ ap as coerceIdText,
834
587
  b3 as collectBytes,
835
588
  createRegistry,
836
589
  csvExporter,
837
590
  csvImporter,
838
- ar as declareCompanion,
839
- as as declareResolved,
591
+ cx2Exporter,
592
+ cx2Importer,
593
+ cxImporter,
594
+ aq as declareCompanion,
595
+ ar as declareResolved,
840
596
  d3 as decodeChunks,
841
- at as decodeEntryName,
597
+ as as decodeEntryName,
842
598
  d2 as dialectCapabilities,
843
599
  dotExporter,
844
600
  dotImporter,
845
601
  e2 as encodeChunks,
846
- f2 as explicitWeights,
602
+ e3 as explicitWeights,
847
603
  exportGraph,
848
604
  exportGraphToString,
849
- extensionOf,
850
- g2 as formatDecimal,
851
- h2 as formatF32,
852
- i2 as formatF64,
853
- j3 as formatGmlReal,
854
- k2 as formatInteger,
605
+ f2 as extensionOf,
606
+ f3 as formatDecimal,
607
+ a17 as formatF32,
608
+ b4 as formatF64,
609
+ c4 as formatGmlReal,
610
+ d4 as formatInteger,
855
611
  gexfExporter,
856
612
  gexfImporter,
857
613
  gmlExporter,
@@ -859,47 +615,47 @@ export {
859
615
  graphmlExporter,
860
616
  graphmlImporter,
861
617
  h3 as hasIllegalXmlChar,
862
- headBytes,
618
+ h2 as headBytes,
863
619
  importAllGraphs,
864
620
  importGraph,
865
- i3 as inferTextDtype,
866
- au as inputLength,
867
- av as isAbortError,
868
- aw as isCanonicalIntegerText,
869
- ax as isImportInput,
870
- l2 as isNmtoken,
871
- a15 as isNumericText,
872
- m2 as isWeightField,
873
- n2 as joinText,
621
+ i4 as inferTextDtype,
622
+ at as inputLength,
623
+ au as isAbortError,
624
+ av as isCanonicalIntegerText,
625
+ aw as isImportInput,
626
+ i2 as isNmtoken,
627
+ a18 as isNumericText,
628
+ i3 as isWeightField,
629
+ j3 as joinText,
874
630
  j2 as jsonCapabilities,
875
631
  jsonExporter,
876
632
  jsonImporter,
877
633
  listGraphs,
878
- o2 as mangleNmtoken,
634
+ m2 as mangleNmtoken,
879
635
  neo4jExporter,
880
636
  neo4jImporter,
881
- normalizeMimeType,
637
+ n2 as normalizeMimeType,
882
638
  oboImporter,
883
- ay as pairFolding,
639
+ ax as pairFolding,
884
640
  pajekExporter,
885
641
  pajekImporter,
886
642
  p3 as parseTextCell,
887
643
  p2 as parseWeightText,
888
644
  rankFormats,
889
- az as readText,
645
+ ay as readText,
890
646
  registry,
891
- aA as reportSinkOptions,
892
- aB as reportUnusedOptions,
893
- aC as resolveExportOptions,
894
- aD as resolveImportOptions,
895
- s2 as sanitizeIds,
647
+ az as reportSinkOptions,
648
+ aA as reportUnusedOptions,
649
+ aB as resolveExportOptions,
650
+ aC as resolveImportOptions,
651
+ s3 as sanitizeIds,
896
652
  sniff,
897
- sniffFormat,
898
- sniffJsonDialectHead,
899
- t as textChunks,
653
+ s2 as sniffFormat,
654
+ g2 as sniffJsonDialectHead,
655
+ aD as textChunks,
900
656
  throwIfAborted,
901
- t2 as toReadableStream,
902
- t3 as tokenizeXml,
657
+ t as toReadableStream,
658
+ t2 as tokenizeXml,
903
659
  x2 as xmlIllegalTextNotes
904
660
  };
905
661
  //# sourceMappingURL=graph-io.js.map