@graphty/graph-io 0.3.25 → 0.3.26

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 (581) hide show
  1. package/README.md +49 -414
  2. package/dist/chunks/children-CL3Cy0ez.js.map +1 -1
  3. package/dist/chunks/choose-BbJI55dx.js +56 -0
  4. package/dist/chunks/choose-BbJI55dx.js.map +1 -0
  5. package/dist/chunks/constants-BCsFsMj4.js +231 -0
  6. package/dist/chunks/constants-BCsFsMj4.js.map +1 -0
  7. package/dist/chunks/{escape-B-tkk_Cl.js → escape-D0g6NNUy.js} +382 -92
  8. package/dist/chunks/escape-D0g6NNUy.js.map +1 -0
  9. package/dist/chunks/export-BTI4yQgy.js +4333 -0
  10. package/dist/chunks/export-BTI4yQgy.js.map +1 -0
  11. package/dist/chunks/exporter-BMqk5oxW.js +3465 -0
  12. package/dist/chunks/exporter-BMqk5oxW.js.map +1 -0
  13. package/dist/chunks/{importer-eUREhBGj.js → exporter-Cra2GYcN.js} +4969 -3201
  14. package/dist/chunks/exporter-Cra2GYcN.js.map +1 -0
  15. package/dist/chunks/{exporter-BGrsWamJ.js → exporter-Dxh231ZF.js} +38 -229
  16. package/dist/chunks/exporter-Dxh231ZF.js.map +1 -0
  17. package/dist/chunks/{exporter-DIeGJXAZ.js → exporter-tne475KK.js} +22 -20
  18. package/dist/chunks/exporter-tne475KK.js.map +1 -0
  19. package/dist/chunks/importer-90YWhJoF.js +2811 -0
  20. package/dist/chunks/importer-90YWhJoF.js.map +1 -0
  21. package/dist/chunks/{importer-D_e7e7LX.js → importer-Bcl1d4xH.js} +398 -145
  22. package/dist/chunks/importer-Bcl1d4xH.js.map +1 -0
  23. package/dist/chunks/{importer-BWY2FFc5.js → importer-BfIsp1f9.js} +255 -77
  24. package/dist/chunks/importer-BfIsp1f9.js.map +1 -0
  25. package/dist/chunks/{importer-zGLo8Dg_.js → importer-C_TEA1zJ.js} +484 -157
  26. package/dist/chunks/importer-C_TEA1zJ.js.map +1 -0
  27. package/dist/chunks/{importer-DET1tg6s.js → importer-DCjOvO7U.js} +1687 -310
  28. package/dist/chunks/importer-DCjOvO7U.js.map +1 -0
  29. package/dist/chunks/{importer-vi3bSdtw.js → importer-DfVu6j59.js} +509 -76
  30. package/dist/chunks/importer-DfVu6j59.js.map +1 -0
  31. package/dist/chunks/{importer-DIrbbnAf.js → importer-Dku_VAIY.js} +585 -226
  32. package/dist/chunks/importer-Dku_VAIY.js.map +1 -0
  33. package/dist/chunks/json-elements-3tnyt5uZ.js +1225 -0
  34. package/dist/chunks/json-elements-3tnyt5uZ.js.map +1 -0
  35. package/dist/chunks/ontology-export-B9Tcf37D.js +357 -0
  36. package/dist/chunks/ontology-export-B9Tcf37D.js.map +1 -0
  37. package/dist/chunks/{records-dbRkxwaq.js → records-CQXT__mY.js} +298 -114
  38. package/dist/chunks/records-CQXT__mY.js.map +1 -0
  39. package/dist/chunks/{text-Dr0Ifpag.js → text-DmcUs5_Q.js} +29 -11
  40. package/dist/chunks/text-DmcUs5_Q.js.map +1 -0
  41. package/dist/chunks/{writer-C7flM-Ih.js → writer-DxjgHwSe.js} +19 -1
  42. package/dist/chunks/writer-DxjgHwSe.js.map +1 -0
  43. package/dist/csv.js +951 -261
  44. package/dist/csv.js.map +1 -1
  45. package/dist/cx.js +6 -3
  46. package/dist/cx2.js +2 -2
  47. package/dist/cys.js +6 -3
  48. package/dist/dot.js +1 -1
  49. package/dist/gexf.js +554 -122
  50. package/dist/gexf.js.map +1 -1
  51. package/dist/gml.js +342 -85
  52. package/dist/gml.js.map +1 -1
  53. package/dist/graph-io.js +1105 -213
  54. package/dist/graph-io.js.map +1 -1
  55. package/dist/graphml.js +3 -2
  56. package/dist/graphml.js.map +1 -1
  57. package/dist/json.js +3 -2
  58. package/dist/neo4j.js +564 -157
  59. package/dist/neo4j.js.map +1 -1
  60. package/dist/obo.js +6 -3
  61. package/dist/pajek.js +1 -1
  62. package/dist/src/children.d.ts +18 -6
  63. package/dist/src/children.d.ts.map +1 -1
  64. package/dist/src/children.js +6 -3
  65. package/dist/src/children.js.map +1 -1
  66. package/dist/src/common/attributes.d.ts +29 -11
  67. package/dist/src/common/attributes.d.ts.map +1 -1
  68. package/dist/src/common/attributes.js +25 -7
  69. package/dist/src/common/attributes.js.map +1 -1
  70. package/dist/src/common/cell-budget.d.ts +9 -2
  71. package/dist/src/common/cell-budget.d.ts.map +1 -1
  72. package/dist/src/common/cell-budget.js +11 -3
  73. package/dist/src/common/cell-budget.js.map +1 -1
  74. package/dist/src/common/choose.d.ts +19 -0
  75. package/dist/src/common/choose.d.ts.map +1 -0
  76. package/dist/src/common/choose.js +72 -0
  77. package/dist/src/common/choose.js.map +1 -0
  78. package/dist/src/common/codes.d.ts +456 -66
  79. package/dist/src/common/codes.d.ts.map +1 -1
  80. package/dist/src/common/codes.js +458 -66
  81. package/dist/src/common/codes.js.map +1 -1
  82. package/dist/src/common/compare.d.ts +81 -0
  83. package/dist/src/common/compare.d.ts.map +1 -0
  84. package/dist/src/common/compare.js +394 -0
  85. package/dist/src/common/compare.js.map +1 -0
  86. package/dist/src/common/cx-export.d.ts +123 -0
  87. package/dist/src/common/cx-export.d.ts.map +1 -0
  88. package/dist/src/common/cx-export.js +334 -0
  89. package/dist/src/common/cx-export.js.map +1 -0
  90. package/dist/src/common/declared-types.d.ts +22 -2
  91. package/dist/src/common/declared-types.d.ts.map +1 -1
  92. package/dist/src/common/declared-types.js +19 -1
  93. package/dist/src/common/declared-types.js.map +1 -1
  94. package/dist/src/common/direction.d.ts +74 -50
  95. package/dist/src/common/direction.d.ts.map +1 -1
  96. package/dist/src/common/direction.js +47 -27
  97. package/dist/src/common/direction.js.map +1 -1
  98. package/dist/src/common/escape.d.ts +21 -9
  99. package/dist/src/common/escape.d.ts.map +1 -1
  100. package/dist/src/common/escape.js +33 -17
  101. package/dist/src/common/escape.js.map +1 -1
  102. package/dist/src/common/export.d.ts +144 -32
  103. package/dist/src/common/export.d.ts.map +1 -1
  104. package/dist/src/common/export.js +216 -42
  105. package/dist/src/common/export.js.map +1 -1
  106. package/dist/src/common/format.d.ts +23 -1
  107. package/dist/src/common/format.d.ts.map +1 -1
  108. package/dist/src/common/format.js +26 -1
  109. package/dist/src/common/format.js.map +1 -1
  110. package/dist/src/common/ids.d.ts +9 -2
  111. package/dist/src/common/ids.d.ts.map +1 -1
  112. package/dist/src/common/ids.js +6 -2
  113. package/dist/src/common/ids.js.map +1 -1
  114. package/dist/src/common/input.d.ts +122 -28
  115. package/dist/src/common/input.d.ts.map +1 -1
  116. package/dist/src/common/input.js +890 -124
  117. package/dist/src/common/input.js.map +1 -1
  118. package/dist/src/common/json-elements.d.ts +144 -20
  119. package/dist/src/common/json-elements.d.ts.map +1 -1
  120. package/dist/src/common/json-elements.js +868 -188
  121. package/dist/src/common/json-elements.js.map +1 -1
  122. package/dist/src/common/line-format.d.ts +90 -0
  123. package/dist/src/common/line-format.d.ts.map +1 -0
  124. package/dist/src/common/line-format.js +185 -0
  125. package/dist/src/common/line-format.js.map +1 -0
  126. package/dist/src/common/lists.d.ts +6 -1
  127. package/dist/src/common/lists.d.ts.map +1 -1
  128. package/dist/src/common/lists.js +2 -0
  129. package/dist/src/common/lists.js.map +1 -1
  130. package/dist/src/common/ontology-export.d.ts +167 -0
  131. package/dist/src/common/ontology-export.d.ts.map +1 -0
  132. package/dist/src/common/ontology-export.js +359 -0
  133. package/dist/src/common/ontology-export.js.map +1 -0
  134. package/dist/src/common/ontology.d.ts +25 -3
  135. package/dist/src/common/ontology.d.ts.map +1 -1
  136. package/dist/src/common/ontology.js +30 -9
  137. package/dist/src/common/ontology.js.map +1 -1
  138. package/dist/src/common/options.d.ts +62 -12
  139. package/dist/src/common/options.d.ts.map +1 -1
  140. package/dist/src/common/options.js +89 -11
  141. package/dist/src/common/options.js.map +1 -1
  142. package/dist/src/common/plural.d.ts +31 -0
  143. package/dist/src/common/plural.d.ts.map +1 -0
  144. package/dist/src/common/plural.js +46 -0
  145. package/dist/src/common/plural.js.map +1 -0
  146. package/dist/src/common/report.d.ts +72 -14
  147. package/dist/src/common/report.d.ts.map +1 -1
  148. package/dist/src/common/report.js +146 -22
  149. package/dist/src/common/report.js.map +1 -1
  150. package/dist/src/common/temporal.d.ts +22 -5
  151. package/dist/src/common/temporal.d.ts.map +1 -1
  152. package/dist/src/common/temporal.js +13 -2
  153. package/dist/src/common/temporal.js.map +1 -1
  154. package/dist/src/common/text.d.ts +39 -23
  155. package/dist/src/common/text.d.ts.map +1 -1
  156. package/dist/src/common/text.js +51 -21
  157. package/dist/src/common/text.js.map +1 -1
  158. package/dist/src/common/weights.d.ts +37 -4
  159. package/dist/src/common/weights.d.ts.map +1 -1
  160. package/dist/src/common/weights.js +61 -2
  161. package/dist/src/common/weights.js.map +1 -1
  162. package/dist/src/common/writer.d.ts +19 -3
  163. package/dist/src/common/writer.d.ts.map +1 -1
  164. package/dist/src/common/writer.js +30 -2
  165. package/dist/src/common/writer.js.map +1 -1
  166. package/dist/src/common/xml.d.ts +125 -9
  167. package/dist/src/common/xml.d.ts.map +1 -1
  168. package/dist/src/common/xml.js +400 -83
  169. package/dist/src/common/xml.js.map +1 -1
  170. package/dist/src/common/zip.d.ts +44 -4
  171. package/dist/src/common/zip.d.ts.map +1 -1
  172. package/dist/src/common/zip.js +134 -5
  173. package/dist/src/common/zip.js.map +1 -1
  174. package/dist/src/formats/csv/exporter.d.ts +80 -24
  175. package/dist/src/formats/csv/exporter.d.ts.map +1 -1
  176. package/dist/src/formats/csv/exporter.js +145 -32
  177. package/dist/src/formats/csv/exporter.js.map +1 -1
  178. package/dist/src/formats/csv/header.d.ts +38 -9
  179. package/dist/src/formats/csv/header.d.ts.map +1 -1
  180. package/dist/src/formats/csv/header.js +46 -10
  181. package/dist/src/formats/csv/header.js.map +1 -1
  182. package/dist/src/formats/csv/importer.d.ts +187 -37
  183. package/dist/src/formats/csv/importer.d.ts.map +1 -1
  184. package/dist/src/formats/csv/importer.js +835 -204
  185. package/dist/src/formats/csv/importer.js.map +1 -1
  186. package/dist/src/formats/csv/index.d.ts +100 -19
  187. package/dist/src/formats/csv/index.d.ts.map +1 -1
  188. package/dist/src/formats/csv/index.js +94 -21
  189. package/dist/src/formats/csv/index.js.map +1 -1
  190. package/dist/src/formats/csv/records.d.ts +95 -10
  191. package/dist/src/formats/csv/records.d.ts.map +1 -1
  192. package/dist/src/formats/csv/records.js +333 -122
  193. package/dist/src/formats/csv/records.js.map +1 -1
  194. package/dist/src/formats/csv/values.d.ts +1 -0
  195. package/dist/src/formats/csv/values.d.ts.map +1 -1
  196. package/dist/src/formats/csv/values.js +1 -0
  197. package/dist/src/formats/csv/values.js.map +1 -1
  198. package/dist/src/formats/cx/exporter.d.ts +102 -0
  199. package/dist/src/formats/cx/exporter.d.ts.map +1 -0
  200. package/dist/src/formats/cx/exporter.js +1217 -0
  201. package/dist/src/formats/cx/exporter.js.map +1 -0
  202. package/dist/src/formats/cx/importer.d.ts +79 -32
  203. package/dist/src/formats/cx/importer.d.ts.map +1 -1
  204. package/dist/src/formats/cx/importer.js +680 -285
  205. package/dist/src/formats/cx/importer.js.map +1 -1
  206. package/dist/src/formats/cx/index.d.ts +4 -3
  207. package/dist/src/formats/cx/index.d.ts.map +1 -1
  208. package/dist/src/formats/cx/index.js +4 -3
  209. package/dist/src/formats/cx/index.js.map +1 -1
  210. package/dist/src/formats/cx2/exporter.d.ts +29 -11
  211. package/dist/src/formats/cx2/exporter.d.ts.map +1 -1
  212. package/dist/src/formats/cx2/exporter.js +39 -268
  213. package/dist/src/formats/cx2/exporter.js.map +1 -1
  214. package/dist/src/formats/cx2/importer.d.ts +78 -28
  215. package/dist/src/formats/cx2/importer.d.ts.map +1 -1
  216. package/dist/src/formats/cx2/importer.js +226 -79
  217. package/dist/src/formats/cx2/importer.js.map +1 -1
  218. package/dist/src/formats/cx2/index.d.ts +2 -1
  219. package/dist/src/formats/cx2/index.d.ts.map +1 -1
  220. package/dist/src/formats/cx2/index.js +2 -1
  221. package/dist/src/formats/cx2/index.js.map +1 -1
  222. package/dist/src/formats/cys/constants.d.ts +66 -17
  223. package/dist/src/formats/cys/constants.d.ts.map +1 -1
  224. package/dist/src/formats/cys/constants.js +59 -18
  225. package/dist/src/formats/cys/constants.js.map +1 -1
  226. package/dist/src/formats/cys/exporter.d.ts +118 -0
  227. package/dist/src/formats/cys/exporter.d.ts.map +1 -0
  228. package/dist/src/formats/cys/exporter.js +1072 -0
  229. package/dist/src/formats/cys/exporter.js.map +1 -0
  230. package/dist/src/formats/cys/importer.d.ts +22 -8
  231. package/dist/src/formats/cys/importer.d.ts.map +1 -1
  232. package/dist/src/formats/cys/importer.js +510 -149
  233. package/dist/src/formats/cys/importer.js.map +1 -1
  234. package/dist/src/formats/cys/index.d.ts +4 -2
  235. package/dist/src/formats/cys/index.d.ts.map +1 -1
  236. package/dist/src/formats/cys/index.js +4 -2
  237. package/dist/src/formats/cys/index.js.map +1 -1
  238. package/dist/src/formats/cys/session.d.ts +46 -7
  239. package/dist/src/formats/cys/session.d.ts.map +1 -1
  240. package/dist/src/formats/cys/session.js +98 -24
  241. package/dist/src/formats/cys/session.js.map +1 -1
  242. package/dist/src/formats/cys/tables.d.ts +9 -2
  243. package/dist/src/formats/cys/tables.d.ts.map +1 -1
  244. package/dist/src/formats/cys/tables.js +29 -7
  245. package/dist/src/formats/cys/tables.js.map +1 -1
  246. package/dist/src/formats/dot/exporter.d.ts +42 -14
  247. package/dist/src/formats/dot/exporter.d.ts.map +1 -1
  248. package/dist/src/formats/dot/exporter.js +56 -29
  249. package/dist/src/formats/dot/exporter.js.map +1 -1
  250. package/dist/src/formats/dot/importer.d.ts +91 -29
  251. package/dist/src/formats/dot/importer.d.ts.map +1 -1
  252. package/dist/src/formats/dot/importer.js +190 -39
  253. package/dist/src/formats/dot/importer.js.map +1 -1
  254. package/dist/src/formats/dot/index.d.ts +2 -1
  255. package/dist/src/formats/dot/index.d.ts.map +1 -1
  256. package/dist/src/formats/dot/index.js +2 -1
  257. package/dist/src/formats/dot/index.js.map +1 -1
  258. package/dist/src/formats/dot/names.d.ts +44 -11
  259. package/dist/src/formats/dot/names.d.ts.map +1 -1
  260. package/dist/src/formats/dot/names.js +44 -11
  261. package/dist/src/formats/dot/names.js.map +1 -1
  262. package/dist/src/formats/dot/tokenizer.d.ts +9 -2
  263. package/dist/src/formats/dot/tokenizer.d.ts.map +1 -1
  264. package/dist/src/formats/dot/tokenizer.js +20 -5
  265. package/dist/src/formats/dot/tokenizer.js.map +1 -1
  266. package/dist/src/formats/gexf/exporter.d.ts +46 -15
  267. package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
  268. package/dist/src/formats/gexf/exporter.js +45 -15
  269. package/dist/src/formats/gexf/exporter.js.map +1 -1
  270. package/dist/src/formats/gexf/importer.d.ts +87 -23
  271. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  272. package/dist/src/formats/gexf/importer.js +471 -90
  273. package/dist/src/formats/gexf/importer.js.map +1 -1
  274. package/dist/src/formats/gexf/index.d.ts +84 -21
  275. package/dist/src/formats/gexf/index.d.ts.map +1 -1
  276. package/dist/src/formats/gexf/index.js +80 -23
  277. package/dist/src/formats/gexf/index.js.map +1 -1
  278. package/dist/src/formats/gexf/schema.d.ts +67 -15
  279. package/dist/src/formats/gexf/schema.d.ts.map +1 -1
  280. package/dist/src/formats/gexf/schema.js +59 -13
  281. package/dist/src/formats/gexf/schema.js.map +1 -1
  282. package/dist/src/formats/gml/exporter.d.ts +69 -21
  283. package/dist/src/formats/gml/exporter.d.ts.map +1 -1
  284. package/dist/src/formats/gml/exporter.js +74 -29
  285. package/dist/src/formats/gml/exporter.js.map +1 -1
  286. package/dist/src/formats/gml/importer.d.ts +116 -25
  287. package/dist/src/formats/gml/importer.d.ts.map +1 -1
  288. package/dist/src/formats/gml/importer.js +290 -61
  289. package/dist/src/formats/gml/importer.js.map +1 -1
  290. package/dist/src/formats/gml/index.d.ts +87 -24
  291. package/dist/src/formats/gml/index.d.ts.map +1 -1
  292. package/dist/src/formats/gml/index.js +79 -26
  293. package/dist/src/formats/gml/index.js.map +1 -1
  294. package/dist/src/formats/gml/syntax.d.ts +67 -18
  295. package/dist/src/formats/gml/syntax.d.ts.map +1 -1
  296. package/dist/src/formats/gml/syntax.js +108 -26
  297. package/dist/src/formats/gml/syntax.js.map +1 -1
  298. package/dist/src/formats/graphml/constants.d.ts +174 -44
  299. package/dist/src/formats/graphml/constants.d.ts.map +1 -1
  300. package/dist/src/formats/graphml/constants.js +165 -44
  301. package/dist/src/formats/graphml/constants.js.map +1 -1
  302. package/dist/src/formats/graphml/exporter.d.ts +17 -9
  303. package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
  304. package/dist/src/formats/graphml/exporter.js +33 -12
  305. package/dist/src/formats/graphml/exporter.js.map +1 -1
  306. package/dist/src/formats/graphml/importer.d.ts +19 -7
  307. package/dist/src/formats/graphml/importer.d.ts.map +1 -1
  308. package/dist/src/formats/graphml/importer.js +466 -39
  309. package/dist/src/formats/graphml/importer.js.map +1 -1
  310. package/dist/src/formats/graphml/index.d.ts +2 -1
  311. package/dist/src/formats/graphml/index.d.ts.map +1 -1
  312. package/dist/src/formats/graphml/index.js +2 -1
  313. package/dist/src/formats/graphml/index.js.map +1 -1
  314. package/dist/src/formats/graphml/tree.d.ts +6 -2
  315. package/dist/src/formats/graphml/tree.d.ts.map +1 -1
  316. package/dist/src/formats/graphml/tree.js +6 -2
  317. package/dist/src/formats/graphml/tree.js.map +1 -1
  318. package/dist/src/formats/graphml/yfiles.d.ts +8 -3
  319. package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
  320. package/dist/src/formats/graphml/yfiles.js +36 -15
  321. package/dist/src/formats/graphml/yfiles.js.map +1 -1
  322. package/dist/src/formats/json/dialect.d.ts +88 -24
  323. package/dist/src/formats/json/dialect.d.ts.map +1 -1
  324. package/dist/src/formats/json/dialect.js +109 -19
  325. package/dist/src/formats/json/dialect.js.map +1 -1
  326. package/dist/src/formats/json/exporter.d.ts +134 -22
  327. package/dist/src/formats/json/exporter.d.ts.map +1 -1
  328. package/dist/src/formats/json/exporter.js +135 -54
  329. package/dist/src/formats/json/exporter.js.map +1 -1
  330. package/dist/src/formats/json/importer.d.ts +173 -52
  331. package/dist/src/formats/json/importer.d.ts.map +1 -1
  332. package/dist/src/formats/json/importer.js +899 -220
  333. package/dist/src/formats/json/importer.js.map +1 -1
  334. package/dist/src/formats/json/index.d.ts +3 -2
  335. package/dist/src/formats/json/index.d.ts.map +1 -1
  336. package/dist/src/formats/json/index.js +3 -2
  337. package/dist/src/formats/json/index.js.map +1 -1
  338. package/dist/src/formats/json/obographs-export.d.ts +68 -0
  339. package/dist/src/formats/json/obographs-export.d.ts.map +1 -0
  340. package/dist/src/formats/json/obographs-export.js +941 -0
  341. package/dist/src/formats/json/obographs-export.js.map +1 -0
  342. package/dist/src/formats/json/obographs.d.ts +26 -0
  343. package/dist/src/formats/json/obographs.d.ts.map +1 -1
  344. package/dist/src/formats/json/obographs.js +297 -80
  345. package/dist/src/formats/json/obographs.js.map +1 -1
  346. package/dist/src/formats/neo4j/exporter.d.ts +109 -21
  347. package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
  348. package/dist/src/formats/neo4j/exporter.js +238 -85
  349. package/dist/src/formats/neo4j/exporter.js.map +1 -1
  350. package/dist/src/formats/neo4j/header.d.ts +17 -4
  351. package/dist/src/formats/neo4j/header.d.ts.map +1 -1
  352. package/dist/src/formats/neo4j/header.js +36 -4
  353. package/dist/src/formats/neo4j/header.js.map +1 -1
  354. package/dist/src/formats/neo4j/importer.d.ts +107 -27
  355. package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
  356. package/dist/src/formats/neo4j/importer.js +415 -63
  357. package/dist/src/formats/neo4j/importer.js.map +1 -1
  358. package/dist/src/formats/neo4j/index.d.ts +73 -23
  359. package/dist/src/formats/neo4j/index.d.ts.map +1 -1
  360. package/dist/src/formats/neo4j/index.js +65 -25
  361. package/dist/src/formats/neo4j/index.js.map +1 -1
  362. package/dist/src/formats/obo/exporter.d.ts +150 -0
  363. package/dist/src/formats/obo/exporter.d.ts.map +1 -0
  364. package/dist/src/formats/obo/exporter.js +1736 -0
  365. package/dist/src/formats/obo/exporter.js.map +1 -0
  366. package/dist/src/formats/obo/importer.d.ts +95 -19
  367. package/dist/src/formats/obo/importer.d.ts.map +1 -1
  368. package/dist/src/formats/obo/importer.js +475 -104
  369. package/dist/src/formats/obo/importer.js.map +1 -1
  370. package/dist/src/formats/obo/index.d.ts +6 -3
  371. package/dist/src/formats/obo/index.d.ts.map +1 -1
  372. package/dist/src/formats/obo/index.js +6 -3
  373. package/dist/src/formats/obo/index.js.map +1 -1
  374. package/dist/src/formats/obo/syntax.d.ts +108 -4
  375. package/dist/src/formats/obo/syntax.d.ts.map +1 -1
  376. package/dist/src/formats/obo/syntax.js +211 -34
  377. package/dist/src/formats/obo/syntax.js.map +1 -1
  378. package/dist/src/formats/pajek/exporter.d.ts +54 -16
  379. package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
  380. package/dist/src/formats/pajek/exporter.js +66 -34
  381. package/dist/src/formats/pajek/exporter.js.map +1 -1
  382. package/dist/src/formats/pajek/importer.d.ts +84 -22
  383. package/dist/src/formats/pajek/importer.d.ts.map +1 -1
  384. package/dist/src/formats/pajek/importer.js +303 -83
  385. package/dist/src/formats/pajek/importer.js.map +1 -1
  386. package/dist/src/formats/pajek/index.d.ts +2 -1
  387. package/dist/src/formats/pajek/index.d.ts.map +1 -1
  388. package/dist/src/formats/pajek/index.js +2 -1
  389. package/dist/src/formats/pajek/index.js.map +1 -1
  390. package/dist/src/formats/pajek/syntax.d.ts +77 -14
  391. package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
  392. package/dist/src/formats/pajek/syntax.js +183 -51
  393. package/dist/src/formats/pajek/syntax.js.map +1 -1
  394. package/dist/src/formats/xgmml/columns.d.ts +1 -0
  395. package/dist/src/formats/xgmml/columns.d.ts.map +1 -1
  396. package/dist/src/formats/xgmml/columns.js +4 -0
  397. package/dist/src/formats/xgmml/columns.js.map +1 -1
  398. package/dist/src/formats/xgmml/constants.d.ts +186 -56
  399. package/dist/src/formats/xgmml/constants.d.ts.map +1 -1
  400. package/dist/src/formats/xgmml/constants.js +181 -57
  401. package/dist/src/formats/xgmml/constants.js.map +1 -1
  402. package/dist/src/formats/xgmml/document.d.ts +65 -11
  403. package/dist/src/formats/xgmml/document.d.ts.map +1 -1
  404. package/dist/src/formats/xgmml/document.js +157 -28
  405. package/dist/src/formats/xgmml/document.js.map +1 -1
  406. package/dist/src/formats/xgmml/emit.d.ts +61 -3
  407. package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
  408. package/dist/src/formats/xgmml/emit.js +129 -26
  409. package/dist/src/formats/xgmml/emit.js.map +1 -1
  410. package/dist/src/formats/xgmml/exporter.d.ts +13 -6
  411. package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
  412. package/dist/src/formats/xgmml/exporter.js +20 -21
  413. package/dist/src/formats/xgmml/exporter.js.map +1 -1
  414. package/dist/src/formats/xgmml/importer.d.ts +33 -12
  415. package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
  416. package/dist/src/formats/xgmml/importer.js +35 -72
  417. package/dist/src/formats/xgmml/importer.js.map +1 -1
  418. package/dist/src/formats/xgmml/index.d.ts +1 -0
  419. package/dist/src/formats/xgmml/index.d.ts.map +1 -1
  420. package/dist/src/formats/xgmml/index.js +1 -0
  421. package/dist/src/formats/xgmml/index.js.map +1 -1
  422. package/dist/src/formats/xgmml/values.d.ts +8 -1
  423. package/dist/src/formats/xgmml/values.d.ts.map +1 -1
  424. package/dist/src/formats/xgmml/values.js +7 -2
  425. package/dist/src/formats/xgmml/values.js.map +1 -1
  426. package/dist/src/index.d.ts +23 -18
  427. package/dist/src/index.d.ts.map +1 -1
  428. package/dist/src/index.js +28 -16
  429. package/dist/src/index.js.map +1 -1
  430. package/dist/src/registry.d.ts +478 -92
  431. package/dist/src/registry.d.ts.map +1 -1
  432. package/dist/src/registry.js +807 -88
  433. package/dist/src/registry.js.map +1 -1
  434. package/dist/src/sniff.d.ts +61 -19
  435. package/dist/src/sniff.d.ts.map +1 -1
  436. package/dist/src/sniff.js +121 -29
  437. package/dist/src/sniff.js.map +1 -1
  438. package/dist/src/types.d.ts +362 -112
  439. package/dist/src/types.d.ts.map +1 -1
  440. package/dist/src/types.js +28 -7
  441. package/dist/src/types.js.map +1 -1
  442. package/dist/xgmml.js +2 -2
  443. package/docs/samples/README.md +25 -0
  444. package/docs/samples/got-edges.csv +353 -0
  445. package/docs/samples/got-network.graphml +1384 -0
  446. package/docs/samples/got-nodes.csv +108 -0
  447. package/docs/samples/got.cx +930 -0
  448. package/docs/samples/got.cx2 +465 -0
  449. package/docs/samples/got.gexf +471 -0
  450. package/docs/samples/got.gml +2650 -0
  451. package/docs/samples/got.json +2546 -0
  452. package/docs/samples/got.net +461 -0
  453. package/docs/samples/movies-nodes.csv +9 -0
  454. package/docs/samples/movies-rels.csv +8 -0
  455. package/docs/samples/networks.cys +0 -0
  456. package/docs/samples/proteins.xgmml +9 -0
  457. package/docs/samples/teams.gv +24 -0
  458. package/docs/samples/vehicles.obo +25 -0
  459. package/package.json +9 -4
  460. package/src/children.ts +18 -6
  461. package/src/common/attributes.ts +29 -11
  462. package/src/common/cell-budget.ts +11 -3
  463. package/src/common/choose.ts +89 -0
  464. package/src/common/codes.ts +490 -66
  465. package/src/common/compare.ts +472 -0
  466. package/src/common/cx-export.ts +432 -0
  467. package/src/common/declared-types.ts +38 -4
  468. package/src/common/direction.ts +78 -51
  469. package/src/common/escape.ts +33 -17
  470. package/src/common/export.ts +284 -47
  471. package/src/common/format.ts +30 -1
  472. package/src/common/ids.ts +14 -3
  473. package/src/common/input.ts +1057 -134
  474. package/src/common/json-elements.ts +1034 -198
  475. package/src/common/line-format.ts +249 -0
  476. package/src/common/lists.ts +6 -1
  477. package/src/common/ontology-export.ts +461 -0
  478. package/src/common/ontology.ts +31 -9
  479. package/src/common/options.ts +110 -15
  480. package/src/common/plural.ts +49 -0
  481. package/src/common/report.ts +168 -25
  482. package/src/common/temporal.ts +22 -5
  483. package/src/common/text.ts +62 -23
  484. package/src/common/weights.ts +74 -4
  485. package/src/common/writer.ts +37 -3
  486. package/src/common/xml.ts +477 -88
  487. package/src/common/zip.ts +169 -7
  488. package/src/formats/csv/exporter.ts +201 -46
  489. package/src/formats/csv/header.ts +50 -11
  490. package/src/formats/csv/importer.ts +1133 -245
  491. package/src/formats/csv/index.ts +106 -19
  492. package/src/formats/csv/records.ts +396 -122
  493. package/src/formats/csv/values.ts +1 -0
  494. package/src/formats/cx/exporter.ts +1483 -0
  495. package/src/formats/cx/importer.ts +888 -300
  496. package/src/formats/cx/index.ts +4 -3
  497. package/src/formats/cx2/exporter.ts +61 -338
  498. package/src/formats/cx2/importer.ts +317 -86
  499. package/src/formats/cx2/index.ts +2 -1
  500. package/src/formats/cys/constants.ts +62 -17
  501. package/src/formats/cys/exporter.ts +1368 -0
  502. package/src/formats/cys/importer.ts +659 -157
  503. package/src/formats/cys/index.ts +4 -2
  504. package/src/formats/cys/session.ts +139 -31
  505. package/src/formats/cys/tables.ts +47 -9
  506. package/src/formats/dot/exporter.ts +83 -37
  507. package/src/formats/dot/importer.ts +248 -54
  508. package/src/formats/dot/index.ts +2 -1
  509. package/src/formats/dot/names.ts +44 -11
  510. package/src/formats/dot/tokenizer.ts +25 -6
  511. package/src/formats/gexf/exporter.ts +57 -18
  512. package/src/formats/gexf/importer.ts +636 -105
  513. package/src/formats/gexf/index.ts +90 -21
  514. package/src/formats/gexf/schema.ts +67 -15
  515. package/src/formats/gml/exporter.ts +90 -36
  516. package/src/formats/gml/importer.ts +388 -67
  517. package/src/formats/gml/index.ts +85 -24
  518. package/src/formats/gml/syntax.ts +111 -26
  519. package/src/formats/graphml/constants.ts +178 -44
  520. package/src/formats/graphml/exporter.ts +52 -18
  521. package/src/formats/graphml/importer.ts +640 -60
  522. package/src/formats/graphml/index.ts +2 -1
  523. package/src/formats/graphml/tree.ts +6 -2
  524. package/src/formats/graphml/yfiles.ts +37 -15
  525. package/src/formats/json/dialect.ts +128 -29
  526. package/src/formats/json/exporter.ts +205 -68
  527. package/src/formats/json/importer.ts +1163 -253
  528. package/src/formats/json/index.ts +3 -1
  529. package/src/formats/json/obographs-export.ts +1197 -0
  530. package/src/formats/json/obographs.ts +353 -92
  531. package/src/formats/neo4j/exporter.ts +320 -101
  532. package/src/formats/neo4j/header.ts +44 -6
  533. package/src/formats/neo4j/importer.ts +512 -73
  534. package/src/formats/neo4j/index.ts +75 -23
  535. package/src/formats/obo/exporter.ts +2210 -0
  536. package/src/formats/obo/importer.ts +622 -109
  537. package/src/formats/obo/index.ts +6 -3
  538. package/src/formats/obo/syntax.ts +232 -37
  539. package/src/formats/pajek/exporter.ts +89 -41
  540. package/src/formats/pajek/importer.ts +407 -93
  541. package/src/formats/pajek/index.ts +2 -1
  542. package/src/formats/pajek/syntax.ts +213 -52
  543. package/src/formats/xgmml/columns.ts +10 -0
  544. package/src/formats/xgmml/constants.ts +183 -56
  545. package/src/formats/xgmml/document.ts +212 -34
  546. package/src/formats/xgmml/emit.ts +175 -34
  547. package/src/formats/xgmml/exporter.ts +35 -27
  548. package/src/formats/xgmml/importer.ts +64 -86
  549. package/src/formats/xgmml/index.ts +1 -0
  550. package/src/formats/xgmml/values.ts +11 -3
  551. package/src/index.ts +81 -11
  552. package/src/registry.ts +1121 -135
  553. package/src/sniff.ts +163 -32
  554. package/src/types.ts +385 -114
  555. package/dist/chunks/escape-B-tkk_Cl.js.map +0 -1
  556. package/dist/chunks/export-Bh60Dv-n.js +0 -582
  557. package/dist/chunks/export-Bh60Dv-n.js.map +0 -1
  558. package/dist/chunks/exporter-BGrsWamJ.js.map +0 -1
  559. package/dist/chunks/exporter-DIeGJXAZ.js.map +0 -1
  560. package/dist/chunks/importer-BWY2FFc5.js.map +0 -1
  561. package/dist/chunks/importer-DD-xv9_Y.js +0 -1471
  562. package/dist/chunks/importer-DD-xv9_Y.js.map +0 -1
  563. package/dist/chunks/importer-DET1tg6s.js.map +0 -1
  564. package/dist/chunks/importer-DEcKhsmQ.js +0 -1614
  565. package/dist/chunks/importer-DEcKhsmQ.js.map +0 -1
  566. package/dist/chunks/importer-DIrbbnAf.js.map +0 -1
  567. package/dist/chunks/importer-D_e7e7LX.js.map +0 -1
  568. package/dist/chunks/importer-eUREhBGj.js.map +0 -1
  569. package/dist/chunks/importer-vi3bSdtw.js.map +0 -1
  570. package/dist/chunks/importer-zGLo8Dg_.js.map +0 -1
  571. package/dist/chunks/json-elements-DDS8N2Dd.js +0 -779
  572. package/dist/chunks/json-elements-DDS8N2Dd.js.map +0 -1
  573. package/dist/chunks/ontology-BnrJ4I98.js +0 -113
  574. package/dist/chunks/ontology-BnrJ4I98.js.map +0 -1
  575. package/dist/chunks/records-dbRkxwaq.js.map +0 -1
  576. package/dist/chunks/report-B1z4WT9e.js +0 -2372
  577. package/dist/chunks/report-B1z4WT9e.js.map +0 -1
  578. package/dist/chunks/text-Dr0Ifpag.js.map +0 -1
  579. package/dist/chunks/weights-Dzba96G3.js +0 -176
  580. package/dist/chunks/weights-Dzba96G3.js.map +0 -1
  581. package/dist/chunks/writer-C7flM-Ih.js.map +0 -1
@@ -8,6 +8,7 @@
8
8
  * The node columns of the OBO vocabulary, keyed by column name (design section 4.2). The names are
9
9
  * the OBO tag names, so a Gene Ontology user finds `namespace`, `def` and `is_obsolete` under the
10
10
  * names the GO documentation uses.
11
+ * @category Plugin helpers
11
12
  */
12
13
  export const OBO_NODE_COLUMNS = Object.freeze({
13
14
  type: { dtype: "dict" },
@@ -65,13 +66,17 @@ const OBO_EDGE_COLUMNS = Object.freeze({
65
66
  qualifiers: { dtype: "json" },
66
67
  meta: { dtype: "json" },
67
68
  });
68
- /** The node column that marks a node made for an undeclared reference (design section 4.2). */
69
+ /**
70
+ * The node column that marks a node made for an undeclared reference (design section 4.2).
71
+ * @category Plugin helpers
72
+ */
69
73
  export const PLACEHOLDER_COLUMN = "graphty.placeholder";
70
74
  /**
71
75
  * The declaration of an OBO vocabulary column.
72
76
  * @param domain - node or edge
73
77
  * @param name - the column name (a key of OBO_NODE_COLUMNS / OBO_EDGE_COLUMNS, or the placeholder column)
74
78
  * @returns the declaration, nullable, with origin `{ format: "obo", id: name }`
79
+ * @category Plugin helpers
75
80
  */
76
81
  export function oboColumnDecl(domain, name) {
77
82
  if (name === PLACEHOLDER_COLUMN) {
@@ -87,24 +92,35 @@ export function oboColumnDecl(domain, name) {
87
92
  }
88
93
  return decl;
89
94
  }
90
- /** The OBO PURL base every OBO Foundry IRI starts with. */
91
- const OBO_PURL = "http://purl.obolibrary.org/obo/";
92
- /** The oboInOwl namespace of the OBO-to-OWL mapping's annotation properties. */
93
- const OBO_IN_OWL = "http://www.geneontology.org/formats/oboInOwl#";
95
+ /**
96
+ * The OBO PURL base every OBO Foundry IRI starts with.
97
+ * @category Plugin helpers
98
+ */
99
+ export const OBO_PURL = "http://purl.obolibrary.org/obo/"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched
100
+ /** The same base under https, which newer OBO Graphs writers use. */
101
+ const OBO_PURL_HTTPS = "https://purl.obolibrary.org/obo/";
102
+ /**
103
+ * The oboInOwl namespace of the OBO-to-OWL mapping's annotation properties.
104
+ * @category Plugin helpers
105
+ */
106
+ export const OBO_IN_OWL = "http://www.geneontology.org/formats/oboInOwl#"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched
94
107
  /**
95
108
  * An IRI as the identifier the `.obo` file writes (the OBO 1.4 mapping, section 5.9, read
96
109
  * backwards): `http://purl.obolibrary.org/obo/GO_0008150` is `GO:0008150` (the prefix is the text
97
110
  * before the first underscore), and `http://purl.obolibrary.org/obo/go#regulates` (how the OWL
98
- * translation writes an unprefixed OBO id: subsets, relations, synonym types) is `regulates`.
111
+ * translation writes an unprefixed OBO id: subsets, relations, synonym types) is `regulates`; the
112
+ * same under `https://purl.obolibrary.org/obo/`.
99
113
  * Every other IRI, and an OBO PURL that fits neither form (`.../obo/T/Female`), is kept.
100
114
  * @param iri - the IRI
101
115
  * @returns the CURIE or local id, or the IRI unchanged
116
+ * @category Plugin helpers
102
117
  */
103
118
  export function compactOboIri(iri) {
104
- if (!iri.startsWith(OBO_PURL)) {
119
+ const base = [OBO_PURL, OBO_PURL_HTTPS].find((b) => iri.startsWith(b));
120
+ if (base === undefined) {
105
121
  return iri;
106
122
  }
107
- const rest = iri.slice(OBO_PURL.length);
123
+ const rest = iri.slice(base.length);
108
124
  const hash = rest.indexOf("#");
109
125
  if (hash > 0) {
110
126
  const local = rest.slice(hash + 1);
@@ -116,13 +132,17 @@ export function compactOboIri(iri) {
116
132
  }
117
133
  return `${rest.slice(0, underscore)}:${rest.slice(underscore + 1)}`;
118
134
  }
119
- /** The OBO synonym scopes. */
135
+ /**
136
+ * The OBO synonym scopes.
137
+ * @category Plugin helpers
138
+ */
120
139
  export const SYNONYM_SCOPES = new Set(["EXACT", "BROAD", "NARROW", "RELATED"]);
121
140
  /**
122
141
  * The OBO synonym scope of an OBO Graphs synonym predicate (`hasExactSynonym`, with or without the
123
142
  * oboInOwl namespace).
124
143
  * @param pred - the predicate
125
144
  * @returns the scope, or null for a predicate that is not one of the four
145
+ * @category Plugin helpers
126
146
  */
127
147
  export function synonymScopeOf(pred) {
128
148
  const local = pred.startsWith(OBO_IN_OWL) ? pred.slice(OBO_IN_OWL.length) : pred;
@@ -134,6 +154,7 @@ export function synonymScopeOf(pred) {
134
154
  * the tags that are annotations), so the `.json` of an ontology fills the same columns as its
135
155
  * `.obo`. `shorthand` is the relation's short name; every predicate not listed is a
136
156
  * `property_value`.
157
+ * @category Plugin helpers
137
158
  */
138
159
  export const OBOGRAPHS_PREDICATE_TAGS = new Map([
139
160
  [`${OBO_IN_OWL}hasOBONamespace`, "namespace"],
@@ -1 +1 @@
1
- {"version":3,"file":"ontology.js","sourceRoot":"","sources":["../../../src/common/ontology.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH;;;;GAIG;AACH,MAAM,CA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K,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAgC,IAAI,GAAG,CAAC;IACzE,CAAC,GAAG,UAAU,iBAAiB,EAAE,WAAW,CAAC;IAC7C,CAAC,GAAG,UAAU,kBAAkB,EAAE,QAAQ,CAAC;IAC3C,CAAC,GAAG,UAAU,YAAY,EAAE,YAAY,CAAC;IACzC,CAAC,GAAG,UAAU,eAAe,EAAE,eAAe,CAAC;IAC/C,CAAC,GAAG,QAAQ,aAAa,EAAE,aAAa,CAAC;IACzC,CAAC,GAAG,UAAU,UAAU,EAAE,UAAU,CAAC;IACrC,CAAC,GAAG,UAAU,WAAW,EAAE,WAAW,CAAC;CAC1C,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Option normalisation for importers and exporters (design sections 8.4 and 8.5): every common
2
+ * Option normalization for importers and exporters (design sections 8.4 and 8.5): every common
3
3
  * option resolved to its documented default, enum values checked (E_UNSUPPORTED, the core's
4
4
  * convention for an option outside its set), and the per-format defaults (`ids`, `defaultDirected`,
5
5
  * `weightFrom`, `addMissingNodes`) supplied by the importer that calls resolveImportOptions().
@@ -8,7 +8,10 @@ import { type DuplicatePolicy, type GraphSink, type IdCoercion } from "@graphty/
8
8
  import { type CommonExportOptions, type CommonImportOptions, type GraphChoiceOptions } from "../types.js";
9
9
  import { SINK_OPTION_CODE } from "./codes.js";
10
10
  import { type ImportReportBuilder } from "./report.js";
11
- /** The defaults an importer supplies for the options whose default is per format (design section 8.4). */
11
+ /**
12
+ * The defaults an importer supplies for the options whose default is per format.
13
+ * @category Plugin helpers
14
+ */
12
15
  export interface ImportFormatDefaults {
13
16
  /** "canonical" for text-cell formats, "keep" for JSON. */
14
17
  readonly ids: IdCoercion;
@@ -20,9 +23,9 @@ export interface ImportFormatDefaults {
20
23
  readonly addMissingNodes?: boolean | undefined;
21
24
  }
22
25
  /**
23
- * CommonImportOptions with every field present (design section 8.4 defaults applied).
24
- * Consumed by the per-format importers and exporters under src/formats.
26
+ * CommonImportOptions with every field present.
25
27
  * @public
28
+ * @category Plugin helpers
26
29
  */
27
30
  export interface ResolvedImportOptions {
28
31
  /** The id coercion rule. */
@@ -58,41 +61,57 @@ export interface ResolvedImportOptions {
58
61
  /** The caller's byte encoding (canonical name), or null to detect it. */
59
62
  readonly encoding: string | null;
60
63
  }
61
- /** CommonExportOptions with every field present (design section 8.5 defaults applied). */
64
+ /**
65
+ * CommonExportOptions with every field present.
66
+ * @category Plugin helpers
67
+ */
62
68
  export interface ResolvedExportOptions {
63
69
  /** "error" never renames a node; "mangle" rewrites and keeps the original. */
64
70
  readonly sanitizeIds: "error" | "mangle";
65
71
  /** What a format without mixed-direction support does with a mixed snapshot. */
66
72
  readonly onMixedDirection: "error" | "directed" | "undirected";
67
73
  }
68
- /** The default error limit of design section 8.4. */
74
+ /**
75
+ * The default error limit: errors tolerated before an import aborts.
76
+ * @category Reports and errors
77
+ */
69
78
  export declare const DEFAULT_ERROR_LIMIT = 100;
70
79
  export { SINK_OPTION_CODE };
71
80
  /**
72
- * Report every builder-policy option the caller explicitly requested that the sink does not use
73
- * (design section 8.4 precedence), one `W_SINK_OPTION` warning per option with the option name as
81
+ * Report every builder-policy option the caller explicitly requested that the sink does not use,
82
+ * one `W_SINK_OPTION` warning per option with the option name as
74
83
  * the element. Options left undefined are never reported: they are defaults, not requests. On the
75
84
  * registry's builder, which is seeded from the same options, nothing is ever reported.
76
85
  * @param sink - the sink the importer pushes into
77
86
  * @param options - the caller's raw options, possibly undefined
78
87
  * @param report - the report to record into
79
88
  * @param enforcesMissingNodes - true when the importer applies `addMissingNodes: false` itself (it
80
- * refuses unknown endpoints before the sink sees them), so that request is honoured on any sink and
89
+ * refuses unknown endpoints before the sink sees them), so that request is honored on any sink and
81
90
  * only `addMissingNodes: true` against a refusing sink is reported
82
91
  * @returns the number of warnings recorded
92
+ * @category Writing a format
83
93
  */
84
94
  export declare function reportSinkOptions(sink: GraphSink, options: CommonImportOptions | undefined, report: ImportReportBuilder, enforcesMissingNodes?: boolean): number;
85
95
  /**
86
96
  * Report every common option the caller set to a non-default value that the format has no use
87
- * for (design section 8.4: "the importer reports every option it could not honour"): one
97
+ * for: one
88
98
  * `W_OPTION_IGNORED` warning (category `unsupported`) per option, the option name as the element.
89
99
  * The builder-policy options are reportSinkOptions()'s and are skipped here.
90
100
  * @param options - the caller's raw options, possibly undefined
91
101
  * @param report - the report to record into
92
102
  * @param used - the common option names the importer reads
93
103
  * @returns the number of warnings recorded
104
+ * @category Writing a format
94
105
  */
95
106
  export declare function reportUnusedOptions(options: CommonImportOptions | undefined, report: ImportReportBuilder, used: ReadonlySet<keyof CommonImportOptions>): number;
107
+ /**
108
+ * Whether the caller chose a graph with `graphIndex` or `graphName`. An importer warns
109
+ * W_MULTIPLE_GRAPHS about the graphs it skipped only when it read the first by default.
110
+ * @param options - the caller's graphIndex / graphName
111
+ * @returns true when either option is set
112
+ * @category Writing a format
113
+ */
114
+ export declare function graphChosen(options: GraphChoiceOptions | undefined): boolean;
96
115
  /**
97
116
  * The graph an importer reads from an input that holds several: the one `graphIndex` or
98
117
  * `graphName` names, else the first. A choice that names no graph is E_GRAPH_NOT_FOUND, a name two
@@ -102,26 +121,57 @@ export declare function reportUnusedOptions(options: CommonImportOptions | undef
102
121
  * @param options - the caller's graphIndex / graphName
103
122
  * @param report - the report a failure is recorded in
104
123
  * @returns the index of the graph to read; E_UNSUPPORTED for an option of the wrong type, or both
124
+ * @category Writing a format
105
125
  */
106
126
  export declare function chooseGraph(names: readonly (string | null)[], options: GraphChoiceOptions | undefined, report: ImportReportBuilder): number;
107
127
  /**
108
- * Apply the design section 8.4 defaults to an importer's common options and check every enum
128
+ * Apply the documented defaults to an importer's common options and check every enum
109
129
  * value. Format-specific options in the same object are ignored here.
110
130
  * @param options - the caller's options, possibly undefined
111
131
  * @param defaults - the importer's per-format defaults
112
132
  * @returns the resolved options; E_UNSUPPORTED for a value outside its set
133
+ * @category Writing a format
113
134
  */
114
135
  export declare function resolveImportOptions(options: CommonImportOptions | undefined, defaults: ImportFormatDefaults): ResolvedImportOptions;
115
136
  /**
116
- * Apply the design section 8.5 defaults to an exporter's common options and check the enum values.
137
+ * Apply the documented defaults to an exporter's common options and check the enum values.
117
138
  * @param options - the caller's options, possibly undefined
118
139
  * @returns the resolved options; E_UNSUPPORTED for a value outside its set
140
+ * @category Writing a format
119
141
  */
120
142
  export declare function resolveExportOptions(options: CommonExportOptions | undefined): ResolvedExportOptions;
143
+ /**
144
+ * The options to pass to another importer that you hand text you already decoded with readText():
145
+ * the caller's options without `encoding` and `onProgress`, which that text no longer needs. Without
146
+ * this, the other importer would warn that `encoding` has no effect on text, and report progress a
147
+ * second time.
148
+ * @example
149
+ * ```ts
150
+ * const text = await readText(input, report, opts);
151
+ * report.include(await csvImporter.import(text, sink, forDecodedText(options)));
152
+ * ```
153
+ * @param options - the caller's import options
154
+ * @returns a copy without `encoding` and `onProgress`
155
+ * @category Writing a format
156
+ */
157
+ export declare function forDecodedText<O extends CommonImportOptions>(options: O | undefined): O;
158
+ /**
159
+ * The dialect names of the built-in formats with a `dialect` save option. One options object shared between formats
160
+ * can hold one format's dialect, and the other formats ignore it, as they ignore any option they do not have.
161
+ */
162
+ export declare const FORMAT_DIALECTS: Readonly<Record<string, readonly string[]>>;
163
+ /**
164
+ * Whether a `dialect` value names another format's dialect, which this format ignores rather than refuses.
165
+ * @param format - this format
166
+ * @param value - the caller's `dialect` option
167
+ * @returns true for another built-in format's dialect name
168
+ */
169
+ export declare function otherFormatDialect(format: string, value: unknown): boolean;
121
170
  /**
122
171
  * A short description of an option value for an error message.
123
172
  * @param value - the value
124
173
  * @returns the JSON text of a primitive, or the type name otherwise
174
+ * @category Plugin helpers
125
175
  */
126
176
  export declare function describe(value: unknown): string;
127
177
  //# sourceMappingURL=options.d.ts.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;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GAAG,qBAAqB,CAMpG;AA+ID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,mBAAmB,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAEvF;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAGtE,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAK1E;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAU/C"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Option normalisation for importers and exporters (design sections 8.4 and 8.5): every common
2
+ * Option normalization for importers and exporters (design sections 8.4 and 8.5): every common
3
3
  * option resolved to its documented default, enum values checked (E_UNSUPPORTED, the core's
4
4
  * convention for an option outside its set), and the per-format defaults (`ids`, `defaultDirected`,
5
5
  * `weightFrom`, `addMissingNodes`) supplied by the importer that calls resolveImportOptions().
@@ -7,6 +7,7 @@
7
7
  import { GraphFormatError } from "@graphty/graph-format";
8
8
  import { AMBIGUOUS_GRAPH_NAME_CODE, GRAPH_NOT_FOUND_CODE, NO_GRAPH_CODE, OPTION_IGNORED_CODE, SINK_OPTION_CODE, } from "./codes.js";
9
9
  import { canonicalEncoding } from "./input.js";
10
+ import { plural } from "./plural.js";
10
11
  const ID_COERCIONS = new Set(["keep", "canonical", "string", "number"]);
11
12
  const NODE_ID_SOURCES = new Set(["id", "label", "index"]);
12
13
  const DUPLICATE_POLICIES = new Set(["keep", "error", "first", "last", "sum", "min", "max"]);
@@ -17,23 +18,27 @@ const WEIGHT_DTYPES = new Set(["f32", "f64"]);
17
18
  const LONG_MODES = new Set(["f64", "string"]);
18
19
  const HYPEREDGE_POLICIES = new Set(["error", "skip", "star", "clique"]);
19
20
  const SANITIZE_MODES = new Set(["error", "mangle"]);
20
- /** The default error limit of design section 8.4. */
21
+ /**
22
+ * The default error limit: errors tolerated before an import aborts.
23
+ * @category Reports and errors
24
+ */
21
25
  export const DEFAULT_ERROR_LIMIT = 100;
22
26
  export { SINK_OPTION_CODE };
23
27
  /** The builder-policy options a sink exposes read-only as `sink.options` (design section 8.4). */
24
28
  const SINK_OPTION_NAMES = ["addMissingNodes", "duplicateEdges", "selfLoops", "weightDtype"];
25
29
  /**
26
- * Report every builder-policy option the caller explicitly requested that the sink does not use
27
- * (design section 8.4 precedence), one `W_SINK_OPTION` warning per option with the option name as
30
+ * Report every builder-policy option the caller explicitly requested that the sink does not use,
31
+ * one `W_SINK_OPTION` warning per option with the option name as
28
32
  * the element. Options left undefined are never reported: they are defaults, not requests. On the
29
33
  * registry's builder, which is seeded from the same options, nothing is ever reported.
30
34
  * @param sink - the sink the importer pushes into
31
35
  * @param options - the caller's raw options, possibly undefined
32
36
  * @param report - the report to record into
33
37
  * @param enforcesMissingNodes - true when the importer applies `addMissingNodes: false` itself (it
34
- * refuses unknown endpoints before the sink sees them), so that request is honoured on any sink and
38
+ * refuses unknown endpoints before the sink sees them), so that request is honored on any sink and
35
39
  * only `addMissingNodes: true` against a refusing sink is reported
36
40
  * @returns the number of warnings recorded
41
+ * @category Writing a format
37
42
  */
38
43
  export function reportSinkOptions(sink, options, report, enforcesMissingNodes = false) {
39
44
  if (options === undefined) {
@@ -69,15 +74,27 @@ const IGNORABLE_OPTION_NAMES = [
69
74
  "restoreMangledIds",
70
75
  "hyperedges",
71
76
  ];
77
+ /** The defaults that are the same in every format (the others, such as `defaultDirected`, differ by format). */
78
+ const FIXED_DEFAULTS = {
79
+ nodeIdFrom: "id",
80
+ duplicateEdges: "keep",
81
+ selfLoops: "keep",
82
+ onMixedDirection: "expand",
83
+ weightDtype: "f64",
84
+ long: "f64",
85
+ restoreMangledIds: true,
86
+ hyperedges: "skip",
87
+ };
72
88
  /**
73
89
  * Report every common option the caller set to a non-default value that the format has no use
74
- * for (design section 8.4: "the importer reports every option it could not honour"): one
90
+ * for: one
75
91
  * `W_OPTION_IGNORED` warning (category `unsupported`) per option, the option name as the element.
76
92
  * The builder-policy options are reportSinkOptions()'s and are skipped here.
77
93
  * @param options - the caller's raw options, possibly undefined
78
94
  * @param report - the report to record into
79
95
  * @param used - the common option names the importer reads
80
96
  * @returns the number of warnings recorded
97
+ * @category Writing a format
81
98
  */
82
99
  export function reportUnusedOptions(options, report, used) {
83
100
  if (options === undefined) {
@@ -89,7 +106,8 @@ export function reportUnusedOptions(options, report, used) {
89
106
  continue;
90
107
  }
91
108
  const value = options[name];
92
- if (value === undefined) {
109
+ if (value === undefined || value === FIXED_DEFAULTS[name]) {
110
+ // an option spelled out at its default changes nothing, whether or not the format reads it
93
111
  continue;
94
112
  }
95
113
  report.warning("unsupported", OPTION_IGNORED_CODE, `option ${name}: ${JSON.stringify(value)} has no effect on the ${report.format} importer`, { element: name });
@@ -97,6 +115,27 @@ export function reportUnusedOptions(options, report, used) {
97
115
  }
98
116
  return recorded;
99
117
  }
118
+ /**
119
+ * Whether the caller chose a graph with `graphIndex` or `graphName`. An importer warns
120
+ * W_MULTIPLE_GRAPHS about the graphs it skipped only when it read the first by default.
121
+ * @param options - the caller's graphIndex / graphName
122
+ * @returns true when either option is set
123
+ * @category Writing a format
124
+ */
125
+ export function graphChosen(options) {
126
+ return options?.graphIndex !== undefined || options?.graphName !== undefined;
127
+ }
128
+ /**
129
+ * The graphs of an input as an E_GRAPH_NOT_FOUND message lists them: their indexes and names, so the
130
+ * caller can choose without a second call.
131
+ * @param names - each graph's name, null for an unnamed graph
132
+ * @returns the text to append, starting with "; "
133
+ */
134
+ function graphNamesText(names) {
135
+ const shown = names.slice(0, 10).map((n, i) => `${i} ${n === null ? "(unnamed)" : JSON.stringify(n)}`);
136
+ const more = names.length > shown.length ? `, and ${names.length - shown.length} more` : "";
137
+ return `; the file holds ${shown.join(", ")}${more}`;
138
+ }
100
139
  /**
101
140
  * The graph an importer reads from an input that holds several: the one `graphIndex` or
102
141
  * `graphName` names, else the first. A choice that names no graph is E_GRAPH_NOT_FOUND, a name two
@@ -106,6 +145,7 @@ export function reportUnusedOptions(options, report, used) {
106
145
  * @param options - the caller's graphIndex / graphName
107
146
  * @param report - the report a failure is recorded in
108
147
  * @returns the index of the graph to read; E_UNSUPPORTED for an option of the wrong type, or both
148
+ * @category Writing a format
109
149
  */
110
150
  export function chooseGraph(names, options, report) {
111
151
  const { graphIndex, graphName } = options ?? {};
@@ -137,22 +177,23 @@ export function chooseGraph(names, options, report) {
137
177
  return report.fail(AMBIGUOUS_GRAPH_NAME_CODE, `graphName ${JSON.stringify(graphName)} names the graphs at indexes ${matches.join(", ")}; pass graphIndex`, { element: graphName });
138
178
  }
139
179
  if (matches.length === 0) {
140
- return report.fail(GRAPH_NOT_FOUND_CODE, `graphName ${JSON.stringify(graphName)} names none of the ${names.length} graph(s)`, { element: graphName }, { names: [...names] });
180
+ return report.fail(GRAPH_NOT_FOUND_CODE, `graphName ${JSON.stringify(graphName)} names none of the ${names.length} graph${plural(names.length)}${graphNamesText(names)}`, { element: graphName }, { names: [...names] });
141
181
  }
142
182
  return matches[0];
143
183
  }
144
184
  const index = graphIndex ?? 0;
145
185
  if (index >= names.length) {
146
- return report.fail(GRAPH_NOT_FOUND_CODE, `graphIndex ${index} is beyond the ${names.length} graph(s)`);
186
+ return report.fail(GRAPH_NOT_FOUND_CODE, `graphIndex ${index} is beyond the ${names.length} graph${plural(names.length)}${graphNamesText(names)}`);
147
187
  }
148
188
  return index;
149
189
  }
150
190
  /**
151
- * Apply the design section 8.4 defaults to an importer's common options and check every enum
191
+ * Apply the documented defaults to an importer's common options and check every enum
152
192
  * value. Format-specific options in the same object are ignored here.
153
193
  * @param options - the caller's options, possibly undefined
154
194
  * @param defaults - the importer's per-format defaults
155
195
  * @returns the resolved options; E_UNSUPPORTED for a value outside its set
196
+ * @category Writing a format
156
197
  */
157
198
  export function resolveImportOptions(options, defaults) {
158
199
  const o = options ?? {};
@@ -176,9 +217,10 @@ export function resolveImportOptions(options, defaults) {
176
217
  });
177
218
  }
178
219
  /**
179
- * Apply the design section 8.5 defaults to an exporter's common options and check the enum values.
220
+ * Apply the documented defaults to an exporter's common options and check the enum values.
180
221
  * @param options - the caller's options, possibly undefined
181
222
  * @returns the resolved options; E_UNSUPPORTED for a value outside its set
223
+ * @category Writing a format
182
224
  */
183
225
  export function resolveExportOptions(options) {
184
226
  const o = options ?? {};
@@ -305,10 +347,46 @@ function encodingOption(value) {
305
347
  }
306
348
  return canonical;
307
349
  }
350
+ /**
351
+ * The options to pass to another importer that you hand text you already decoded with readText():
352
+ * the caller's options without `encoding` and `onProgress`, which that text no longer needs. Without
353
+ * this, the other importer would warn that `encoding` has no effect on text, and report progress a
354
+ * second time.
355
+ * @example
356
+ * ```ts
357
+ * const text = await readText(input, report, opts);
358
+ * report.include(await csvImporter.import(text, sink, forDecodedText(options)));
359
+ * ```
360
+ * @param options - the caller's import options
361
+ * @returns a copy without `encoding` and `onProgress`
362
+ * @category Writing a format
363
+ */
364
+ export function forDecodedText(options) {
365
+ return { ...options, encoding: undefined, onProgress: undefined };
366
+ }
367
+ /**
368
+ * The dialect names of the built-in formats with a `dialect` save option. One options object shared between formats
369
+ * can hold one format's dialect, and the other formats ignore it, as they ignore any option they do not have.
370
+ */
371
+ export const FORMAT_DIALECTS = Object.freeze({
372
+ csv: Object.freeze(["gephi", "generic"]),
373
+ json: Object.freeze(["node-link", "d3", "jgf", "cytoscape", "graphology", "vis", "obographs"]),
374
+ });
375
+ /**
376
+ * Whether a `dialect` value names another format's dialect, which this format ignores rather than refuses.
377
+ * @param format - this format
378
+ * @param value - the caller's `dialect` option
379
+ * @returns true for another built-in format's dialect name
380
+ */
381
+ export function otherFormatDialect(format, value) {
382
+ return (typeof value === "string" &&
383
+ Object.entries(FORMAT_DIALECTS).some(([f, names]) => f !== format && names.includes(value)));
384
+ }
308
385
  /**
309
386
  * A short description of an option value for an error message.
310
387
  * @param value - the value
311
388
  * @returns the JSON text of a primitive, or the type name otherwise
389
+ * @category Plugin helpers
312
390
  */
313
391
  export function describe(value) {
314
392
  switch (typeof value) {
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/common/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,gBAAgB,EAAmC,MAAM,uBAAuB,CAAC;AAGhH,OAAO,EACH,yBAAyB,EACzB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA+D/C,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7F,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC/E,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACjH,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACnF,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1G,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;AAChG,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK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AAS,IAAI,CAAC,OAA4B;IACtC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Count agreement for messages, so a report says "1 node is" and "3 nodes are", never "1 node(s) are".
3
+ */
4
+ /**
5
+ * The plural ending of a regular noun after a count.
6
+ * @param n - the count
7
+ * @returns "" for 1, "s" otherwise
8
+ */
9
+ export declare function plural(n: number): string;
10
+ /**
11
+ * The form of a verb that agrees with a count.
12
+ * @param n - the count
13
+ * @param one - the form for 1 ("is", "was", "holds")
14
+ * @param many - the form for any other count ("are", "were", "hold")
15
+ * @returns `one` or `many`
16
+ */
17
+ export declare function agree(n: number, one: string, many: string): string;
18
+ /**
19
+ * A count of nodes and edges, leaving out a zero: "2 nodes and 1 edge", "1 edge".
20
+ * @param nodes - the node count
21
+ * @param edges - the edge count
22
+ * @returns the text
23
+ */
24
+ export declare function elementCount(nodes: number, edges: number): string;
25
+ /**
26
+ * A word with its indefinite article, chosen by its first letter: "an integer", "a double".
27
+ * @param word - the word
28
+ * @returns "a word" or "an word"
29
+ */
30
+ export declare function withArticle(word: string): string;
31
+ //# sourceMappingURL=plural.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plural.d.ts","sourceRoot":"","sources":["../../../src/common/plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASjE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Count agreement for messages, so a report says "1 node is" and "3 nodes are", never "1 node(s) are".
3
+ */
4
+ /**
5
+ * The plural ending of a regular noun after a count.
6
+ * @param n - the count
7
+ * @returns "" for 1, "s" otherwise
8
+ */
9
+ export function plural(n) {
10
+ return n === 1 ? "" : "s";
11
+ }
12
+ /**
13
+ * The form of a verb that agrees with a count.
14
+ * @param n - the count
15
+ * @param one - the form for 1 ("is", "was", "holds")
16
+ * @param many - the form for any other count ("are", "were", "hold")
17
+ * @returns `one` or `many`
18
+ */
19
+ export function agree(n, one, many) {
20
+ return n === 1 ? one : many;
21
+ }
22
+ /**
23
+ * A count of nodes and edges, leaving out a zero: "2 nodes and 1 edge", "1 edge".
24
+ * @param nodes - the node count
25
+ * @param edges - the edge count
26
+ * @returns the text
27
+ */
28
+ export function elementCount(nodes, edges) {
29
+ const parts = [];
30
+ if (nodes > 0 || edges === 0) {
31
+ parts.push(`${nodes} node${plural(nodes)}`);
32
+ }
33
+ if (edges > 0) {
34
+ parts.push(`${edges} edge${plural(edges)}`);
35
+ }
36
+ return parts.join(" and ");
37
+ }
38
+ /**
39
+ * A word with its indefinite article, chosen by its first letter: "an integer", "a double".
40
+ * @param word - the word
41
+ * @returns "a word" or "an word"
42
+ */
43
+ export function withArticle(word) {
44
+ return `${/^[aeiou]/i.test(word) ? "an" : "a"} ${word}`;
45
+ }
46
+ //# sourceMappingURL=plural.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plural.js","sourceRoot":"","sources":["../../../src/common/plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,CAAS,EAAE,GAAW,EAAE,IAAY;IACtD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,KAAa;IACrD,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,QAAQ,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACZ,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,QAAQ,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;AAC5D,CAAC"}