@graphty/graph-io 0.3.36 → 0.3.38

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 (203) hide show
  1. package/dist/chunks/{choose-494CpuXQ.js → choose-CsO24U-5.js} +2 -2
  2. package/dist/chunks/{choose-494CpuXQ.js.map → choose-CsO24U-5.js.map} +1 -1
  3. package/dist/chunks/{constants-BBK4rsQZ.js → constants-BPRiVyBu.js} +2 -2
  4. package/dist/chunks/{constants-BBK4rsQZ.js.map → constants-BPRiVyBu.js.map} +1 -1
  5. package/dist/chunks/{escape-wVIEtLv6.js → escape-BRcyzD77.js} +4 -4
  6. package/dist/chunks/{escape-wVIEtLv6.js.map → escape-BRcyzD77.js.map} +1 -1
  7. package/dist/chunks/{export-Cbt4h_0n.js → export-CTUlibzr.js} +4 -4
  8. package/dist/chunks/export-CTUlibzr.js.map +1 -0
  9. package/dist/chunks/{exporter-DMxRy-0l.js → exporter-Bf5tZA0X.js} +5 -5
  10. package/dist/chunks/exporter-Bf5tZA0X.js.map +1 -0
  11. package/dist/chunks/{exporter-CqnmKk-f.js → exporter-Bn4jdYfd.js} +5 -5
  12. package/dist/chunks/exporter-Bn4jdYfd.js.map +1 -0
  13. package/dist/chunks/{exporter-LZTIAzkS.js → exporter-D-qQuRcG.js} +9 -9
  14. package/dist/chunks/exporter-D-qQuRcG.js.map +1 -0
  15. package/dist/chunks/{exporter-CkPnJCXU.js → exporter-F0vT919P.js} +4 -4
  16. package/dist/chunks/exporter-F0vT919P.js.map +1 -0
  17. package/dist/chunks/{importer-DvPvd4Yy.js → importer-Bgb9sgZZ.js} +9 -9
  18. package/dist/chunks/importer-Bgb9sgZZ.js.map +1 -0
  19. package/dist/chunks/{importer-BTSvNJUB.js → importer-BuzbaFFY.js} +10 -4
  20. package/dist/chunks/importer-BuzbaFFY.js.map +1 -0
  21. package/dist/chunks/{importer-CSmH218L.js → importer-CEuUmyPe.js} +10 -10
  22. package/dist/chunks/importer-CEuUmyPe.js.map +1 -0
  23. package/dist/chunks/{importer-C1VMuEBQ.js → importer-CNMQnHDd.js} +11 -11
  24. package/dist/chunks/importer-CNMQnHDd.js.map +1 -0
  25. package/dist/chunks/{importer-DMgcD1wI.js → importer-DqMtyYLX.js} +11 -11
  26. package/dist/chunks/importer-DqMtyYLX.js.map +1 -0
  27. package/dist/chunks/{importer-BTbjwN10.js → importer-oIUx9u_g.js} +9 -9
  28. package/dist/chunks/importer-oIUx9u_g.js.map +1 -0
  29. package/dist/chunks/{importer-DtKPzhVp.js → importer-yWUPR_nU.js} +13 -13
  30. package/dist/chunks/importer-yWUPR_nU.js.map +1 -0
  31. package/dist/chunks/{json-elements-CxJF-Szz.js → json-elements-AkglPS3m.js} +4 -4
  32. package/dist/chunks/json-elements-AkglPS3m.js.map +1 -0
  33. package/dist/chunks/{ontology-export-p1PsPenq.js → ontology-export-DDoG3egY.js} +2 -2
  34. package/dist/chunks/{ontology-export-p1PsPenq.js.map → ontology-export-DDoG3egY.js.map} +1 -1
  35. package/dist/chunks/{records-BrfHycmg.js → records-ChmWZGuz.js} +2 -2
  36. package/dist/chunks/{records-BrfHycmg.js.map → records-ChmWZGuz.js.map} +1 -1
  37. package/dist/chunks/{text-BD-TzLNm.js → text-Btw3sBe_.js} +2 -2
  38. package/dist/chunks/{text-BD-TzLNm.js.map → text-Btw3sBe_.js.map} +1 -1
  39. package/dist/csv.js +4 -4
  40. package/dist/csv.js.map +1 -1
  41. package/dist/cx.js +1 -1
  42. package/dist/cx2.js +2 -2
  43. package/dist/cys.js +1 -1
  44. package/dist/dot.js +1 -1
  45. package/dist/gexf.js +30 -30
  46. package/dist/gexf.js.map +1 -1
  47. package/dist/gml.js +9 -9
  48. package/dist/gml.js.map +1 -1
  49. package/dist/graph-io.js +28 -28
  50. package/dist/graph-io.js.map +1 -1
  51. package/dist/graphml.js +2 -2
  52. package/dist/json.js +1 -1
  53. package/dist/neo4j.js +8 -8
  54. package/dist/neo4j.js.map +1 -1
  55. package/dist/obo.js +1 -1
  56. package/dist/pajek.js +1 -1
  57. package/dist/src/common/attributes.d.ts +1 -2
  58. package/dist/src/common/attributes.d.ts.map +1 -1
  59. package/dist/src/common/attributes.js +2 -2
  60. package/dist/src/common/attributes.js.map +1 -1
  61. package/dist/src/common/cx-export.d.ts +5 -2
  62. package/dist/src/common/cx-export.d.ts.map +1 -1
  63. package/dist/src/common/cx-export.js +11 -2
  64. package/dist/src/common/cx-export.js.map +1 -1
  65. package/dist/src/common/direction.d.ts +1 -2
  66. package/dist/src/common/direction.d.ts.map +1 -1
  67. package/dist/src/common/direction.js +2 -2
  68. package/dist/src/common/direction.js.map +1 -1
  69. package/dist/src/common/escape.js +1 -1
  70. package/dist/src/common/escape.js.map +1 -1
  71. package/dist/src/common/export.js +1 -1
  72. package/dist/src/common/export.js.map +1 -1
  73. package/dist/src/common/ids.d.ts +1 -2
  74. package/dist/src/common/ids.d.ts.map +1 -1
  75. package/dist/src/common/ids.js +1 -2
  76. package/dist/src/common/ids.js.map +1 -1
  77. package/dist/src/common/input.d.ts +1 -2
  78. package/dist/src/common/input.d.ts.map +1 -1
  79. package/dist/src/common/input.js +2 -2
  80. package/dist/src/common/input.js.map +1 -1
  81. package/dist/src/common/json-elements.js +1 -1
  82. package/dist/src/common/json-elements.js.map +1 -1
  83. package/dist/src/common/options.d.ts +1 -2
  84. package/dist/src/common/options.d.ts.map +1 -1
  85. package/dist/src/common/options.js +1 -1
  86. package/dist/src/common/options.js.map +1 -1
  87. package/dist/src/common/xml.js +1 -1
  88. package/dist/src/common/xml.js.map +1 -1
  89. package/dist/src/formats/cx/exporter.js +1 -1
  90. package/dist/src/formats/cx/exporter.js.map +1 -1
  91. package/dist/src/formats/cx/importer.js +6 -6
  92. package/dist/src/formats/cx/importer.js.map +1 -1
  93. package/dist/src/formats/cx2/exporter.js +1 -1
  94. package/dist/src/formats/cx2/exporter.js.map +1 -1
  95. package/dist/src/formats/cys/importer.js +3 -3
  96. package/dist/src/formats/cys/importer.js.map +1 -1
  97. package/dist/src/formats/cys/tables.js +1 -1
  98. package/dist/src/formats/cys/tables.js.map +1 -1
  99. package/dist/src/formats/dot/exporter.js +3 -3
  100. package/dist/src/formats/dot/exporter.js.map +1 -1
  101. package/dist/src/formats/dot/importer.js +1 -1
  102. package/dist/src/formats/dot/importer.js.map +1 -1
  103. package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
  104. package/dist/src/formats/gexf/exporter.js +24 -27
  105. package/dist/src/formats/gexf/exporter.js.map +1 -1
  106. package/dist/src/formats/gexf/importer.d.ts +1 -2
  107. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  108. package/dist/src/formats/gexf/importer.js +5 -5
  109. package/dist/src/formats/gexf/importer.js.map +1 -1
  110. package/dist/src/formats/gml/exporter.js +4 -4
  111. package/dist/src/formats/gml/exporter.js.map +1 -1
  112. package/dist/src/formats/gml/importer.js.map +1 -1
  113. package/dist/src/formats/gml/syntax.js +2 -2
  114. package/dist/src/formats/gml/syntax.js.map +1 -1
  115. package/dist/src/formats/graphml/exporter.js +3 -3
  116. package/dist/src/formats/graphml/exporter.js.map +1 -1
  117. package/dist/src/formats/graphml/importer.js +2 -2
  118. package/dist/src/formats/graphml/importer.js.map +1 -1
  119. package/dist/src/formats/graphml/tree.js +2 -2
  120. package/dist/src/formats/graphml/tree.js.map +1 -1
  121. package/dist/src/formats/json/dialect.js +1 -1
  122. package/dist/src/formats/json/dialect.js.map +1 -1
  123. package/dist/src/formats/json/exporter.js +1 -1
  124. package/dist/src/formats/json/exporter.js.map +1 -1
  125. package/dist/src/formats/json/importer.js +1 -1
  126. package/dist/src/formats/json/importer.js.map +1 -1
  127. package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
  128. package/dist/src/formats/neo4j/exporter.js +4 -7
  129. package/dist/src/formats/neo4j/exporter.js.map +1 -1
  130. package/dist/src/formats/neo4j/header.js +2 -2
  131. package/dist/src/formats/neo4j/header.js.map +1 -1
  132. package/dist/src/formats/obo/syntax.js +1 -1
  133. package/dist/src/formats/obo/syntax.js.map +1 -1
  134. package/dist/src/formats/pajek/exporter.js +4 -4
  135. package/dist/src/formats/pajek/exporter.js.map +1 -1
  136. package/dist/src/formats/xgmml/document.js +6 -6
  137. package/dist/src/formats/xgmml/document.js.map +1 -1
  138. package/dist/src/formats/xgmml/emit.js +2 -2
  139. package/dist/src/formats/xgmml/emit.js.map +1 -1
  140. package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
  141. package/dist/src/formats/xgmml/exporter.js +1 -1
  142. package/dist/src/formats/xgmml/exporter.js.map +1 -1
  143. package/dist/src/formats/xgmml/importer.js +1 -1
  144. package/dist/src/formats/xgmml/importer.js.map +1 -1
  145. package/dist/src/registry.js +2 -2
  146. package/dist/src/registry.js.map +1 -1
  147. package/dist/src/sniff.js +1 -1
  148. package/dist/src/sniff.js.map +1 -1
  149. package/dist/xgmml.js +2 -2
  150. package/package.json +2 -2
  151. package/src/common/attributes.ts +1 -2
  152. package/src/common/cx-export.ts +11 -2
  153. package/src/common/direction.ts +2 -2
  154. package/src/common/escape.ts +1 -1
  155. package/src/common/export.ts +1 -1
  156. package/src/common/ids.ts +1 -3
  157. package/src/common/input.ts +2 -2
  158. package/src/common/json-elements.ts +1 -1
  159. package/src/common/options.ts +1 -1
  160. package/src/common/xml.ts +1 -1
  161. package/src/formats/csv/importer.ts +1 -1
  162. package/src/formats/cx/exporter.ts +1 -1
  163. package/src/formats/cx/importer.ts +6 -6
  164. package/src/formats/cx2/exporter.ts +1 -1
  165. package/src/formats/cys/importer.ts +3 -3
  166. package/src/formats/cys/tables.ts +1 -1
  167. package/src/formats/dot/exporter.ts +3 -3
  168. package/src/formats/dot/importer.ts +2 -2
  169. package/src/formats/gexf/exporter.ts +24 -28
  170. package/src/formats/gexf/importer.ts +5 -5
  171. package/src/formats/gml/exporter.ts +4 -4
  172. package/src/formats/gml/importer.ts +1 -1
  173. package/src/formats/gml/syntax.ts +2 -2
  174. package/src/formats/graphml/exporter.ts +3 -3
  175. package/src/formats/graphml/importer.ts +2 -2
  176. package/src/formats/graphml/tree.ts +2 -2
  177. package/src/formats/json/dialect.ts +1 -1
  178. package/src/formats/json/exporter.ts +1 -1
  179. package/src/formats/json/importer.ts +1 -1
  180. package/src/formats/neo4j/exporter.ts +4 -7
  181. package/src/formats/neo4j/header.ts +2 -2
  182. package/src/formats/obo/syntax.ts +1 -1
  183. package/src/formats/pajek/exporter.ts +4 -4
  184. package/src/formats/pajek/importer.ts +1 -1
  185. package/src/formats/xgmml/document.ts +6 -6
  186. package/src/formats/xgmml/emit.ts +2 -2
  187. package/src/formats/xgmml/exporter.ts +5 -2
  188. package/src/formats/xgmml/importer.ts +1 -1
  189. package/src/registry.ts +2 -2
  190. package/src/sniff.ts +1 -1
  191. package/dist/chunks/export-Cbt4h_0n.js.map +0 -1
  192. package/dist/chunks/exporter-CkPnJCXU.js.map +0 -1
  193. package/dist/chunks/exporter-CqnmKk-f.js.map +0 -1
  194. package/dist/chunks/exporter-DMxRy-0l.js.map +0 -1
  195. package/dist/chunks/exporter-LZTIAzkS.js.map +0 -1
  196. package/dist/chunks/importer-BTSvNJUB.js.map +0 -1
  197. package/dist/chunks/importer-BTbjwN10.js.map +0 -1
  198. package/dist/chunks/importer-C1VMuEBQ.js.map +0 -1
  199. package/dist/chunks/importer-CSmH218L.js.map +0 -1
  200. package/dist/chunks/importer-DMgcD1wI.js.map +0 -1
  201. package/dist/chunks/importer-DtKPzhVp.js.map +0 -1
  202. package/dist/chunks/importer-DvPvd4Yy.js.map +0 -1
  203. package/dist/chunks/json-elements-CxJF-Szz.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { GraphFormatError, INVALID_INDEX, MAX_COUNT } from "@graphty/graph-format";
2
2
  import { c as childrenCsr } from "./children-CL3Cy0ez.js";
3
- import { r as resolveExportOptions, c as capabilities, a as checkCapabilities, L as LOSS, p as pairFolding, b as plural, $ as agree, aE as sanitizeIds, e as explicitWeights, bz as isNmtoken, bx as isCanonicalIntegerText, bA as mangleNmtoken, aG as formatInteger, ab as formatF64, aa as formatF32, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, a4 as textChunks, am as throwIfAborted, ar as IdCoercer, aq as DirectionResolver, aJ as isWeightField, bH as declareAttribute, a0 as uniqueColumnName, a1 as declareResolved, bW as takenIn, aK as parseWeightText, bK as parseDeclaredValue, bL as losesPrecision, P as PRECISION_CODE, bI as overflowsToInfinity } from "./export-Cbt4h_0n.js";
4
- import { a as escapeXmlText, j as isWhitespace, n as isXmlName, e as escapeXmlAttribute, l as localName, x as xmlIllegalTextNotes, t as tokenizeXml, f as xmlDeclaredEncoding, g as XmlEmptyInputError, X as XmlSyntaxError, s as sniffXmlText } from "./escape-wVIEtLv6.js";
3
+ import { r as resolveExportOptions, c as capabilities, a as checkCapabilities, L as LOSS, p as pairFolding, b as plural, $ as agree, aE as sanitizeIds, e as explicitWeights, bz as isNmtoken, bx as isCanonicalIntegerText, bA as mangleNmtoken, aG as formatInteger, ab as formatF64, aa as formatF32, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, a4 as textChunks, am as throwIfAborted, ar as IdCoercer, aq as DirectionResolver, aJ as isWeightField, bH as declareAttribute, a0 as uniqueColumnName, a1 as declareResolved, bW as takenIn, aK as parseWeightText, bK as parseDeclaredValue, bL as losesPrecision, P as PRECISION_CODE, bI as overflowsToInfinity } from "./export-CTUlibzr.js";
4
+ import { a as escapeXmlText, j as isWhitespace, n as isXmlName, e as escapeXmlAttribute, l as localName, x as xmlIllegalTextNotes, t as tokenizeXml, f as xmlDeclaredEncoding, g as XmlEmptyInputError, X as XmlSyntaxError, s as sniffXmlText } from "./escape-BRcyzD77.js";
5
5
  import { j as joinText, e as encodeChunks } from "./writer-DxjgHwSe.js";
6
- import { F as FORMAT, a as GRAPHML_LOSS, Y as YFILES_NAMESPACE, X as XSI_NAMESPACE, S as SCHEMA_LOCATION, b as GRAPHML_NAMESPACE, O as ORIGINAL_ID_ATTRIBUTE, M as META_KEY, L as LABEL_COLUMN, R as RESERVED_NODE_NAMES, c as RESERVED_EDGE_NAMES, P as PARENT_COLUMN, T as TARGET_PORT_COLUMN, d as SOURCE_PORT_COLUMN, E as EDGE_ID_COLUMN, e as MIME_TYPES, f as EXTENSIONS, G as GRAPHML_ISSUE, g as ORIGINAL_ID_COLUMN, H as HYPEREDGE_HUB_COLUMN } from "./constants-BBK4rsQZ.js";
6
+ import { F as FORMAT, a as GRAPHML_LOSS, Y as YFILES_NAMESPACE, X as XSI_NAMESPACE, S as SCHEMA_LOCATION, b as GRAPHML_NAMESPACE, O as ORIGINAL_ID_ATTRIBUTE, M as META_KEY, L as LABEL_COLUMN, R as RESERVED_NODE_NAMES, c as RESERVED_EDGE_NAMES, P as PARENT_COLUMN, T as TARGET_PORT_COLUMN, d as SOURCE_PORT_COLUMN, E as EDGE_ID_COLUMN, e as MIME_TYPES, f as EXTENSIONS, G as GRAPHML_ISSUE, g as ORIGINAL_ID_COLUMN, H as HYPEREDGE_HUB_COLUMN } from "./constants-BPRiVyBu.js";
7
7
  const ATTRIBUTE_PREFIX = "@_";
8
8
  const TEXT_KEY = "#text";
9
9
  class XmlTreeBuilder {
@@ -38,7 +38,7 @@ class XmlTreeBuilder {
38
38
  * @param text - the text
39
39
  */
40
40
  text(text2) {
41
- const frame = this.frames.length > 0 ? this.frames[this.frames.length - 1] : this.root;
41
+ const frame = this.frames.at(-1) ?? this.root;
42
42
  frame.text += text2;
43
43
  }
44
44
  /** The current element ends; its value is attached to its parent. */
@@ -49,7 +49,7 @@ class XmlTreeBuilder {
49
49
  reason: "tree builder underflow"
50
50
  });
51
51
  }
52
- const parent = this.frames.length > 0 ? this.frames[this.frames.length - 1] : this.root;
52
+ const parent = this.frames.at(-1) ?? this.root;
53
53
  attachChild(parent, frame.name, valueOf(frame));
54
54
  }
55
55
  /**
@@ -1109,7 +1109,7 @@ function keyElement(key, indent) {
1109
1109
  }
1110
1110
  const { column } = key;
1111
1111
  const desc = column?.meta.extra.desc;
1112
- const hasDefault = column !== null && column.meta.default !== void 0;
1112
+ const hasDefault = column?.meta.default !== void 0;
1113
1113
  if (column === null || typeof desc !== "string" && !hasDefault) {
1114
1114
  return `${text2}/>
1115
1115
  `;
@@ -1191,7 +1191,7 @@ function* writeGraphml(snapshot, plan) {
1191
1191
  const step = plan.pretty ? " " : "";
1192
1192
  yield '<?xml version="1.0" encoding="UTF-8"?>\n';
1193
1193
  let root = `<graphml xmlns="${GRAPHML_NAMESPACE}"`;
1194
- const namespaces = { ...plan.meta?.namespaces ?? {} };
1194
+ const namespaces = { ...plan.meta?.namespaces };
1195
1195
  if ((plan.nodeColumns.some((c) => c.yfiles) || plan.edgeColumns.some((c) => c.yfiles) || plan.graphColumns.some((c) => c.yfiles)) && !Object.values(namespaces).includes(YFILES_NAMESPACE)) {
1196
1196
  namespaces.y = YFILES_NAMESPACE;
1197
1197
  }
@@ -1288,7 +1288,7 @@ ${i1}</graph>
1288
1288
  `;
1289
1289
  }
1290
1290
  function portText(column, e) {
1291
- if (column === null || !column.isSet(e)) {
1291
+ if (!column?.isSet(e)) {
1292
1292
  return null;
1293
1293
  }
1294
1294
  const value = column.value(e);
@@ -1555,7 +1555,7 @@ class GraphmlReader {
1555
1555
  * @param ns - the element's namespace (null: an undeclared prefix)
1556
1556
  */
1557
1557
  start(name, attrs, line, ns = "") {
1558
- const parent = this.ctx.length === 0 ? null : this.ctx[this.ctx.length - 1];
1558
+ const parent = this.ctx.at(-1) ?? null;
1559
1559
  switch (parent) {
1560
1560
  case 9:
1561
1561
  this.captureStart(name, attrs);
@@ -1681,7 +1681,7 @@ class GraphmlReader {
1681
1681
  * @param line - the line
1682
1682
  */
1683
1683
  text(text2, line) {
1684
- const ctx = this.ctx.length === 0 ? null : this.ctx[this.ctx.length - 1];
1684
+ const ctx = this.ctx.at(-1) ?? null;
1685
1685
  switch (ctx) {
1686
1686
  case 9:
1687
1687
  this.content.tree?.text(text2);
@@ -3697,4 +3697,4 @@ export {
3697
3697
  graphmlImporter as a,
3698
3698
  graphmlExporter as g
3699
3699
  };
3700
- //# sourceMappingURL=importer-DMgcD1wI.js.map
3700
+ //# sourceMappingURL=importer-DqMtyYLX.js.map