@graphty/graph-io 0.3.46 → 0.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{approximations-wWjCRzKj.js → approximations-C2riR4NT.js} +2 -2
- package/dist/chunks/{approximations-wWjCRzKj.js.map → approximations-C2riR4NT.js.map} +1 -1
- package/dist/chunks/{block-DiGq58c3.js → block-Cu22ewuS.js} +92 -21
- package/dist/chunks/block-Cu22ewuS.js.map +1 -0
- package/dist/chunks/{choose--jM0yYCo.js → choose-Cdx6Enl2.js} +3 -3
- package/dist/chunks/{choose--jM0yYCo.js.map → choose-Cdx6Enl2.js.map} +1 -1
- package/dist/chunks/codes-CV_Bhcyi.js +153 -0
- package/dist/chunks/codes-CV_Bhcyi.js.map +1 -0
- package/dist/chunks/{constants-BKwqelYD.js → constants-D0LqcsLJ.js} +2 -2
- package/dist/chunks/{constants-BKwqelYD.js.map → constants-D0LqcsLJ.js.map} +1 -1
- package/dist/chunks/context-cgmmOxZ2.js +663 -0
- package/dist/chunks/context-cgmmOxZ2.js.map +1 -0
- package/dist/chunks/credentials-BiQsnMTb.js +347 -0
- package/dist/chunks/credentials-BiQsnMTb.js.map +1 -0
- package/dist/chunks/cx-export-BEeF6ymo.js +259 -0
- package/dist/chunks/cx-export-BEeF6ymo.js.map +1 -0
- package/dist/chunks/descriptor-BJ-W0Jd-.js +137 -0
- package/dist/chunks/descriptor-BJ-W0Jd-.js.map +1 -0
- package/dist/chunks/descriptor-C-YDhtsn.js +48 -0
- package/dist/chunks/descriptor-C-YDhtsn.js.map +1 -0
- package/dist/chunks/{emit-CwU8cUmG.js → emit-CD8xnY8s.js} +70 -10
- package/dist/chunks/emit-CD8xnY8s.js.map +1 -0
- package/dist/chunks/{escape-CgzxiYPg.js → escape-DH2Egt-l.js} +12 -12
- package/dist/chunks/{escape-CgzxiYPg.js.map → escape-DH2Egt-l.js.map} +1 -1
- package/dist/chunks/{export-BvqAXCKh.js → export-CZ7VRm4I.js} +53 -1443
- package/dist/chunks/export-CZ7VRm4I.js.map +1 -0
- package/dist/chunks/{exporter-DndFlGSa.js → exporter-BIdaoIgh.js} +7 -6
- package/dist/chunks/{exporter-DndFlGSa.js.map → exporter-BIdaoIgh.js.map} +1 -1
- package/dist/chunks/{exporter-CJgfhF-l.js → exporter-ChjL5fmP.js} +8 -7
- package/dist/chunks/{exporter-CJgfhF-l.js.map → exporter-ChjL5fmP.js.map} +1 -1
- package/dist/chunks/{exporter--Mk9gXCJ.js → exporter-Dcw7Ldtq.js} +6 -4
- package/dist/chunks/{exporter--Mk9gXCJ.js.map → exporter-Dcw7Ldtq.js.map} +1 -1
- package/dist/chunks/exporter-DtVU80Fa.js +1008 -0
- package/dist/chunks/exporter-DtVU80Fa.js.map +1 -0
- package/dist/chunks/{exporter-CrDWIyiq.js → exporter-bxxjOrDZ.js} +11 -9
- package/dist/chunks/{exporter-CrDWIyiq.js.map → exporter-bxxjOrDZ.js.map} +1 -1
- package/dist/chunks/format-BMS-1Nxb.js +64 -0
- package/dist/chunks/format-BMS-1Nxb.js.map +1 -0
- package/dist/chunks/{generic-Dq1ntt9q.js → generic-CP6YD34u.js} +4 -4
- package/dist/chunks/{generic-Dq1ntt9q.js.map → generic-CP6YD34u.js.map} +1 -1
- package/dist/chunks/{importer-DiZRmOQG.js → importer-B87_fmVx.js} +13 -17
- package/dist/chunks/importer-B87_fmVx.js.map +1 -0
- package/dist/chunks/{importer-BSvfrX_h.js → importer-Bji2MeWr.js} +18 -1014
- package/dist/chunks/importer-Bji2MeWr.js.map +1 -0
- package/dist/chunks/{importer-COTK9Tsl.js → importer-CB_zV5_L.js} +14 -11
- package/dist/chunks/importer-CB_zV5_L.js.map +1 -0
- package/dist/chunks/{importer-e6LGpqHB.js → importer-CVT-JyDE.js} +12 -9
- package/dist/chunks/importer-CVT-JyDE.js.map +1 -0
- package/dist/chunks/{importer-yh_aBCU6.js → importer-Cyy6UseH.js} +7 -6
- package/dist/chunks/{importer-yh_aBCU6.js.map → importer-Cyy6UseH.js.map} +1 -1
- package/dist/chunks/{importer-iFYPEKaJ.js → importer-DPZDN40-.js} +14 -10
- package/dist/chunks/{importer-iFYPEKaJ.js.map → importer-DPZDN40-.js.map} +1 -1
- package/dist/chunks/{importer-CMmeMWlC.js → importer-e3huMZbm.js} +8 -260
- package/dist/chunks/importer-e3huMZbm.js.map +1 -0
- package/dist/chunks/input-Ccg9I22A.js +1397 -0
- package/dist/chunks/input-Ccg9I22A.js.map +1 -0
- package/dist/chunks/{json-elements-DJZRZ6jd.js → json-elements-By172SVq.js} +4 -4
- package/dist/chunks/{json-elements-DJZRZ6jd.js.map → json-elements-By172SVq.js.map} +1 -1
- package/dist/chunks/{lexicon-CT69Kd87.js → lexicon-u2SI5xcx.js} +19 -5
- package/dist/chunks/lexicon-u2SI5xcx.js.map +1 -0
- package/dist/chunks/{ontology-export-G4MqRdux.js → ontology-export-BwgMyuF0.js} +4 -3
- package/dist/chunks/{ontology-export-G4MqRdux.js.map → ontology-export-BwgMyuF0.js.map} +1 -1
- package/dist/chunks/{records-CiaWZrFH.js → records-Cgvxz-Vx.js} +2 -2
- package/dist/chunks/{records-CiaWZrFH.js.map → records-Cgvxz-Vx.js.map} +1 -1
- package/dist/chunks/{format-BpQBx8MZ.js → report-CgdsL9Hb.js} +72 -129
- package/dist/chunks/report-CgdsL9Hb.js.map +1 -0
- package/dist/chunks/sigv4-LkAzsLAu.js +247 -0
- package/dist/chunks/sigv4-LkAzsLAu.js.map +1 -0
- package/dist/chunks/{styles-BQnsga7p.js → styles-CaABMoO1.js} +76 -43
- package/dist/chunks/styles-CaABMoO1.js.map +1 -0
- package/dist/chunks/{styles-D3fRphrO.js → styles-P_gmFAOi.js} +101 -21
- package/dist/chunks/styles-P_gmFAOi.js.map +1 -0
- package/dist/chunks/{styles-yed-BF5x3_Y5.js → styles-yed-Cs1nmrjn.js} +60 -20
- package/dist/chunks/styles-yed-Cs1nmrjn.js.map +1 -0
- package/dist/chunks/{text-CzJNFOS9.js → text-BuKQVMz2.js} +2 -2
- package/dist/chunks/{text-CzJNFOS9.js.map → text-BuKQVMz2.js.map} +1 -1
- package/dist/chunks/{writer-DMKvthQE.js → writer-DvHTl36J.js} +5 -4
- package/dist/chunks/writer-DvHTl36J.js.map +1 -0
- package/dist/csv.js +7 -5
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +5 -4
- package/dist/cx.js.map +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +2 -2
- package/dist/gexf.js +7 -5
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +16 -13
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +1181 -224
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +3 -3
- package/dist/json.js +1 -1
- package/dist/neo4j.js +6 -4
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/sources-cypher.d.ts +1 -0
- package/dist/sources-cypher.js +1236 -0
- package/dist/sources-cypher.js.map +1 -0
- package/dist/sources-ndex.d.ts +1 -0
- package/dist/sources-ndex.js +278 -0
- package/dist/sources-ndex.js.map +1 -0
- package/dist/sources-rest.d.ts +1 -0
- package/dist/sources-rest.js +1367 -0
- package/dist/sources-rest.js.map +1 -0
- package/dist/src/common/report.d.ts +6 -3
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +15 -9
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/formats/cx/styles.d.ts.map +1 -1
- package/dist/src/formats/cx/styles.js +1 -0
- package/dist/src/formats/cx/styles.js.map +1 -1
- package/dist/src/formats/dot/styles.d.ts.map +1 -1
- package/dist/src/formats/dot/styles.js +3 -1
- package/dist/src/formats/dot/styles.js.map +1 -1
- package/dist/src/formats/gexf/styles.d.ts +29 -12
- package/dist/src/formats/gexf/styles.d.ts.map +1 -1
- package/dist/src/formats/gexf/styles.js +160 -31
- package/dist/src/formats/gexf/styles.js.map +1 -1
- package/dist/src/formats/gml/styles.d.ts.map +1 -1
- package/dist/src/formats/gml/styles.js +5 -4
- package/dist/src/formats/gml/styles.js.map +1 -1
- package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-plain.js +3 -3
- package/dist/src/formats/graphml/styles-plain.js.map +1 -1
- package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-yed.js +89 -19
- package/dist/src/formats/graphml/styles-yed.js.map +1 -1
- package/dist/src/formats/pajek/styles.d.ts.map +1 -1
- package/dist/src/formats/pajek/styles.js +1 -0
- package/dist/src/formats/pajek/styles.js.map +1 -1
- package/dist/src/formats/xgmml/styles.d.ts.map +1 -1
- package/dist/src/formats/xgmml/styles.js +1 -0
- package/dist/src/formats/xgmml/styles.js.map +1 -1
- package/dist/src/index.d.ts +8 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry.d.ts +173 -1
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +196 -1
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sources/builtins.d.ts +11 -0
- package/dist/src/sources/builtins.d.ts.map +1 -0
- package/dist/src/sources/builtins.js +47 -0
- package/dist/src/sources/builtins.js.map +1 -0
- package/dist/src/sources/codes.d.ts +230 -0
- package/dist/src/sources/codes.d.ts.map +1 -0
- package/dist/src/sources/codes.js +58 -0
- package/dist/src/sources/codes.js.map +1 -0
- package/dist/src/sources/context.d.ts +112 -0
- package/dist/src/sources/context.d.ts.map +1 -0
- package/dist/src/sources/context.js +739 -0
- package/dist/src/sources/context.js.map +1 -0
- package/dist/src/sources/credentials.d.ts +179 -0
- package/dist/src/sources/credentials.d.ts.map +1 -0
- package/dist/src/sources/credentials.js +301 -0
- package/dist/src/sources/credentials.js.map +1 -0
- package/dist/src/sources/cypher/descriptor.d.ts +21 -0
- package/dist/src/sources/cypher/descriptor.d.ts.map +1 -0
- package/dist/src/sources/cypher/descriptor.js +119 -0
- package/dist/src/sources/cypher/descriptor.js.map +1 -0
- package/dist/src/sources/cypher/flatten.d.ts +72 -0
- package/dist/src/sources/cypher/flatten.d.ts.map +1 -0
- package/dist/src/sources/cypher/flatten.js +279 -0
- package/dist/src/sources/cypher/flatten.js.map +1 -0
- package/dist/src/sources/cypher/index.d.ts +33 -0
- package/dist/src/sources/cypher/index.d.ts.map +1 -0
- package/dist/src/sources/cypher/index.js +405 -0
- package/dist/src/sources/cypher/index.js.map +1 -0
- package/dist/src/sources/cypher/params.d.ts +40 -0
- package/dist/src/sources/cypher/params.d.ts.map +1 -0
- package/dist/src/sources/cypher/params.js +6 -0
- package/dist/src/sources/cypher/params.js.map +1 -0
- package/dist/src/sources/cypher/profiles.d.ts +44 -0
- package/dist/src/sources/cypher/profiles.d.ts.map +1 -0
- package/dist/src/sources/cypher/profiles.js +61 -0
- package/dist/src/sources/cypher/profiles.js.map +1 -0
- package/dist/src/sources/cypher/query-builder.d.ts +106 -0
- package/dist/src/sources/cypher/query-builder.d.ts.map +1 -0
- package/dist/src/sources/cypher/query-builder.js +236 -0
- package/dist/src/sources/cypher/query-builder.js.map +1 -0
- package/dist/src/sources/cypher/transports/bolt.d.ts +21 -0
- package/dist/src/sources/cypher/transports/bolt.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/bolt.js +185 -0
- package/dist/src/sources/cypher/transports/bolt.js.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.d.ts +15 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.js +38 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.js.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-https.d.ts +31 -0
- package/dist/src/sources/cypher/transports/neptune-https.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-https.js +104 -0
- package/dist/src/sources/cypher/transports/neptune-https.js.map +1 -0
- package/dist/src/sources/cypher/transports/query-api.d.ts +14 -0
- package/dist/src/sources/cypher/transports/query-api.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/query-api.js +80 -0
- package/dist/src/sources/cypher/transports/query-api.js.map +1 -0
- package/dist/src/sources/cypher/transports/transport.d.ts +78 -0
- package/dist/src/sources/cypher/transports/transport.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/transport.js +77 -0
- package/dist/src/sources/cypher/transports/transport.js.map +1 -0
- package/dist/src/sources/cypher/types-map.d.ts +91 -0
- package/dist/src/sources/cypher/types-map.d.ts.map +1 -0
- package/dist/src/sources/cypher/types-map.js +306 -0
- package/dist/src/sources/cypher/types-map.js.map +1 -0
- package/dist/src/sources/define.d.ts +47 -0
- package/dist/src/sources/define.d.ts.map +1 -0
- package/dist/src/sources/define.js +173 -0
- package/dist/src/sources/define.js.map +1 -0
- package/dist/src/sources/fail.d.ts +33 -0
- package/dist/src/sources/fail.d.ts.map +1 -0
- package/dist/src/sources/fail.js +49 -0
- package/dist/src/sources/fail.js.map +1 -0
- package/dist/src/sources/ids.d.ts +64 -0
- package/dist/src/sources/ids.d.ts.map +1 -0
- package/dist/src/sources/ids.js +64 -0
- package/dist/src/sources/ids.js.map +1 -0
- package/dist/src/sources/ndex/client.d.ts +31 -0
- package/dist/src/sources/ndex/client.d.ts.map +1 -0
- package/dist/src/sources/ndex/client.js +90 -0
- package/dist/src/sources/ndex/client.js.map +1 -0
- package/dist/src/sources/ndex/descriptor.d.ts +10 -0
- package/dist/src/sources/ndex/descriptor.d.ts.map +1 -0
- package/dist/src/sources/ndex/descriptor.js +55 -0
- package/dist/src/sources/ndex/descriptor.js.map +1 -0
- package/dist/src/sources/ndex/expand.d.ts +20 -0
- package/dist/src/sources/ndex/expand.d.ts.map +1 -0
- package/dist/src/sources/ndex/expand.js +87 -0
- package/dist/src/sources/ndex/expand.js.map +1 -0
- package/dist/src/sources/ndex/index.d.ts +25 -0
- package/dist/src/sources/ndex/index.d.ts.map +1 -0
- package/dist/src/sources/ndex/index.js +191 -0
- package/dist/src/sources/ndex/index.js.map +1 -0
- package/dist/src/sources/ndex/params.d.ts +17 -0
- package/dist/src/sources/ndex/params.d.ts.map +1 -0
- package/dist/src/sources/ndex/params.js +6 -0
- package/dist/src/sources/ndex/params.js.map +1 -0
- package/dist/src/sources/ndex/share-url.d.ts +40 -0
- package/dist/src/sources/ndex/share-url.d.ts.map +1 -0
- package/dist/src/sources/ndex/share-url.js +64 -0
- package/dist/src/sources/ndex/share-url.js.map +1 -0
- package/dist/src/sources/params.d.ts +28 -0
- package/dist/src/sources/params.d.ts.map +1 -0
- package/dist/src/sources/params.js +6 -0
- package/dist/src/sources/params.js.map +1 -0
- package/dist/src/sources/registry.d.ts +118 -0
- package/dist/src/sources/registry.d.ts.map +1 -0
- package/dist/src/sources/registry.js +193 -0
- package/dist/src/sources/registry.js.map +1 -0
- package/dist/src/sources/rest/descriptor.d.ts +16 -0
- package/dist/src/sources/rest/descriptor.d.ts.map +1 -0
- package/dist/src/sources/rest/descriptor.js +71 -0
- package/dist/src/sources/rest/descriptor.js.map +1 -0
- package/dist/src/sources/rest/index.d.ts +14 -0
- package/dist/src/sources/rest/index.d.ts.map +1 -0
- package/dist/src/sources/rest/index.js +13 -0
- package/dist/src/sources/rest/index.js.map +1 -0
- package/dist/src/sources/rest/mapping.d.ts +30 -0
- package/dist/src/sources/rest/mapping.d.ts.map +1 -0
- package/dist/src/sources/rest/mapping.js +362 -0
- package/dist/src/sources/rest/mapping.js.map +1 -0
- package/dist/src/sources/rest/openalex.d.ts +27 -0
- package/dist/src/sources/rest/openalex.d.ts.map +1 -0
- package/dist/src/sources/rest/openalex.js +269 -0
- package/dist/src/sources/rest/openalex.js.map +1 -0
- package/dist/src/sources/rest/paging.d.ts +53 -0
- package/dist/src/sources/rest/paging.d.ts.map +1 -0
- package/dist/src/sources/rest/paging.js +138 -0
- package/dist/src/sources/rest/paging.js.map +1 -0
- package/dist/src/sources/rest/params.d.ts +216 -0
- package/dist/src/sources/rest/params.d.ts.map +1 -0
- package/dist/src/sources/rest/params.js +7 -0
- package/dist/src/sources/rest/params.js.map +1 -0
- package/dist/src/sources/rest/records.d.ts +41 -0
- package/dist/src/sources/rest/records.d.ts.map +1 -0
- package/dist/src/sources/rest/records.js +240 -0
- package/dist/src/sources/rest/records.js.map +1 -0
- package/dist/src/sources/rest/samples/deps-dev.d.ts +10 -0
- package/dist/src/sources/rest/samples/deps-dev.d.ts.map +1 -0
- package/dist/src/sources/rest/samples/deps-dev.js +47 -0
- package/dist/src/sources/rest/samples/deps-dev.js.map +1 -0
- package/dist/src/sources/rest/samples/string.d.ts +9 -0
- package/dist/src/sources/rest/samples/string.d.ts.map +1 -0
- package/dist/src/sources/rest/samples/string.js +42 -0
- package/dist/src/sources/rest/samples/string.js.map +1 -0
- package/dist/src/sources/rest/selectors.d.ts +41 -0
- package/dist/src/sources/rest/selectors.d.ts.map +1 -0
- package/dist/src/sources/rest/selectors.js +81 -0
- package/dist/src/sources/rest/selectors.js.map +1 -0
- package/dist/src/sources/rest/source.d.ts +67 -0
- package/dist/src/sources/rest/source.d.ts.map +1 -0
- package/dist/src/sources/rest/source.js +635 -0
- package/dist/src/sources/rest/source.js.map +1 -0
- package/dist/src/sources/rest/templates.d.ts +38 -0
- package/dist/src/sources/rest/templates.d.ts.map +1 -0
- package/dist/src/sources/rest/templates.js +125 -0
- package/dist/src/sources/rest/templates.js.map +1 -0
- package/dist/src/sources/run.d.ts +93 -0
- package/dist/src/sources/run.d.ts.map +1 -0
- package/dist/src/sources/run.js +673 -0
- package/dist/src/sources/run.js.map +1 -0
- package/dist/src/sources/sha256.d.ts +12 -0
- package/dist/src/sources/sha256.d.ts.map +1 -0
- package/dist/src/sources/sha256.js +95 -0
- package/dist/src/sources/sha256.js.map +1 -0
- package/dist/src/sources/sigv4.d.ts +24 -0
- package/dist/src/sources/sigv4.d.ts.map +1 -0
- package/dist/src/sources/sigv4.js +182 -0
- package/dist/src/sources/sigv4.js.map +1 -0
- package/dist/src/sources/testing.d.ts +96 -0
- package/dist/src/sources/testing.d.ts.map +1 -0
- package/dist/src/sources/testing.js +138 -0
- package/dist/src/sources/testing.js.map +1 -0
- package/dist/src/sources/types.d.ts +665 -0
- package/dist/src/sources/types.d.ts.map +1 -0
- package/dist/src/sources/types.js +10 -0
- package/dist/src/sources/types.js.map +1 -0
- package/dist/src/styles/canon/enums.d.ts.map +1 -1
- package/dist/src/styles/canon/enums.js +1 -0
- package/dist/src/styles/canon/enums.js.map +1 -1
- package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
- package/dist/src/styles/cyjs/cascade.js +68 -2
- package/dist/src/styles/cyjs/cascade.js.map +1 -1
- package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
- package/dist/src/styles/cyjs/defaults-table.js +2 -0
- package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
- package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
- package/dist/src/styles/cyjs/emit.js +18 -7
- package/dist/src/styles/cyjs/emit.js.map +1 -1
- package/dist/src/styles/cyjs/mappers.d.ts +4 -1
- package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
- package/dist/src/styles/cyjs/mappers.js +2 -0
- package/dist/src/styles/cyjs/mappers.js.map +1 -1
- package/dist/src/styles/cytoscape/emit.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/emit.js +59 -7
- package/dist/src/styles/cytoscape/emit.js.map +1 -1
- package/dist/src/styles/cytoscape/lexicon.d.ts +6 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/lexicon.js +26 -2
- package/dist/src/styles/cytoscape/lexicon.js.map +1 -1
- package/dist/src/styles/cytoscape/resolve.d.ts +4 -1
- package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/resolve.js +10 -6
- package/dist/src/styles/cytoscape/resolve.js.map +1 -1
- package/dist/src/styles/cytoscape/translate.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/translate.js +10 -10
- package/dist/src/styles/cytoscape/translate.js.map +1 -1
- package/dist/src/styles/defaults.d.ts +30 -0
- package/dist/src/styles/defaults.d.ts.map +1 -1
- package/dist/src/styles/defaults.js +45 -4
- package/dist/src/styles/defaults.js.map +1 -1
- package/dist/src/styles/io/block.d.ts.map +1 -1
- package/dist/src/styles/io/block.js +9 -0
- package/dist/src/styles/io/block.js.map +1 -1
- package/dist/src/styles/io/writer.d.ts.map +1 -1
- package/dist/src/styles/io/writer.js +7 -3
- package/dist/src/styles/io/writer.js.map +1 -1
- package/dist/src/styles/plan/resolve.d.ts +2 -1
- package/dist/src/styles/plan/resolve.d.ts.map +1 -1
- package/dist/src/styles/plan/resolve.js +13 -2
- package/dist/src/styles/plan/resolve.js.map +1 -1
- package/dist/src/styles/types.d.ts +19 -2
- package/dist/src/styles/types.d.ts.map +1 -1
- package/dist/src/styles/vocabulary.d.ts.map +1 -1
- package/dist/src/styles/vocabulary.js +15 -1
- package/dist/src/styles/vocabulary.js.map +1 -1
- package/dist/src/types.d.ts +19 -5
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/styles.js +11 -11
- package/dist/xgmml.js +3 -3
- package/docs/samples/people.json +6 -0
- package/package.json +29 -4
- package/src/common/report.ts +27 -7
- package/src/formats/cx/styles.ts +1 -0
- package/src/formats/dot/styles.ts +3 -1
- package/src/formats/gexf/styles.ts +185 -37
- package/src/formats/gml/styles.ts +5 -4
- package/src/formats/graphml/styles-plain.ts +3 -9
- package/src/formats/graphml/styles-yed.ts +93 -20
- package/src/formats/pajek/styles.ts +1 -0
- package/src/formats/xgmml/styles.ts +1 -0
- package/src/index.ts +90 -0
- package/src/registry.ts +326 -1
- package/src/sources/builtins.ts +56 -0
- package/src/sources/codes.ts +235 -0
- package/src/sources/context.ts +893 -0
- package/src/sources/credentials.ts +409 -0
- package/src/sources/cypher/descriptor.ts +125 -0
- package/src/sources/cypher/flatten.ts +323 -0
- package/src/sources/cypher/index.ts +498 -0
- package/src/sources/cypher/params.ts +41 -0
- package/src/sources/cypher/profiles.ts +78 -0
- package/src/sources/cypher/query-builder.ts +294 -0
- package/src/sources/cypher/transports/bolt.ts +228 -0
- package/src/sources/cypher/transports/neptune-analytics.ts +41 -0
- package/src/sources/cypher/transports/neptune-https.ts +122 -0
- package/src/sources/cypher/transports/query-api.ts +100 -0
- package/src/sources/cypher/transports/transport.ts +139 -0
- package/src/sources/cypher/types-map.ts +418 -0
- package/src/sources/define.ts +195 -0
- package/src/sources/fail.ts +70 -0
- package/src/sources/ids.ts +74 -0
- package/src/sources/ndex/client.ts +102 -0
- package/src/sources/ndex/descriptor.ts +64 -0
- package/src/sources/ndex/expand.ts +100 -0
- package/src/sources/ndex/index.ts +235 -0
- package/src/sources/ndex/params.ts +17 -0
- package/src/sources/ndex/share-url.ts +84 -0
- package/src/sources/params.ts +29 -0
- package/src/sources/registry.ts +325 -0
- package/src/sources/rest/descriptor.ts +74 -0
- package/src/sources/rest/index.ts +22 -0
- package/src/sources/rest/mapping.ts +401 -0
- package/src/sources/rest/openalex.ts +288 -0
- package/src/sources/rest/paging.ts +180 -0
- package/src/sources/rest/params.ts +243 -0
- package/src/sources/rest/records.ts +289 -0
- package/src/sources/rest/samples/deps-dev.ts +49 -0
- package/src/sources/rest/samples/string.ts +44 -0
- package/src/sources/rest/selectors.ts +91 -0
- package/src/sources/rest/source.ts +760 -0
- package/src/sources/rest/templates.ts +151 -0
- package/src/sources/run.ts +793 -0
- package/src/sources/sha256.ts +99 -0
- package/src/sources/sigv4.ts +207 -0
- package/src/sources/testing.ts +210 -0
- package/src/sources/types.ts +741 -0
- package/src/styles/canon/enums.ts +1 -0
- package/src/styles/cyjs/cascade.ts +81 -2
- package/src/styles/cyjs/defaults-table.ts +2 -0
- package/src/styles/cyjs/emit.ts +18 -7
- package/src/styles/cyjs/mappers.ts +6 -1
- package/src/styles/cytoscape/emit.ts +61 -7
- package/src/styles/cytoscape/lexicon.ts +28 -2
- package/src/styles/cytoscape/resolve.ts +22 -6
- package/src/styles/cytoscape/translate.ts +11 -11
- package/src/styles/defaults.ts +93 -4
- package/src/styles/io/block.ts +10 -0
- package/src/styles/io/writer.ts +8 -3
- package/src/styles/plan/resolve.ts +14 -2
- package/src/styles/types.ts +28 -2
- package/src/styles/vocabulary.ts +15 -1
- package/src/types.ts +19 -5
- package/dist/chunks/block-DiGq58c3.js.map +0 -1
- package/dist/chunks/emit-CwU8cUmG.js.map +0 -1
- package/dist/chunks/export-BvqAXCKh.js.map +0 -1
- package/dist/chunks/format-BpQBx8MZ.js.map +0 -1
- package/dist/chunks/importer-BSvfrX_h.js.map +0 -1
- package/dist/chunks/importer-CMmeMWlC.js.map +0 -1
- package/dist/chunks/importer-COTK9Tsl.js.map +0 -1
- package/dist/chunks/importer-DiZRmOQG.js.map +0 -1
- package/dist/chunks/importer-e6LGpqHB.js.map +0 -1
- package/dist/chunks/lexicon-CT69Kd87.js.map +0 -1
- package/dist/chunks/styles-BQnsga7p.js.map +0 -1
- package/dist/chunks/styles-D3fRphrO.js.map +0 -1
- package/dist/chunks/styles-yed-BF5x3_Y5.js.map +0 -1
- package/dist/chunks/writer-DMKvthQE.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-Ccg9I22A.js","sources":["../../src/common/input.ts"],"sourcesContent":["/**\n * Input handling shared by every importer (design section 8.4): the ImportInput union (whole\n * text, whole bytes, a byte stream, an async iterable of text or byte chunks) read as a sequence of\n * text chunks, as lines, or as one string, with BOM handling, cancellation through an AbortSignal\n * and byte progress.\n *\n * Bytes are decoded ONCE, here, for every importer. The encoding is, in order of precedence: a\n * byte order mark (UTF-8, UTF-16LE, UTF-16BE; a UTF-32 one is E_INVALID_ENCODING); the caller's\n * `encoding` option; the encoding the file declares (the importer's `declaredEncoding` reader: the\n * XML prolog for GEXF and GraphML, the `charset` attribute for DOT); else UTF-8. Whenever two of\n * them disagree the one that applies is named in a W_ENCODING_CONFLICT warning. BOM-less UTF-16\n * (every other byte 0) is E_INVALID_ENCODING asking for the option, and a known non-graph file (an\n * HTML page, a PDF, gzip or zip data, a PNG) is E_FOREIGN_FORMAT. Decoding is strict (`fatal: true`): an invalid sequence\n * is never a silent U+FFFD that could alias two ids. Only in the last case, when bytes that are not\n * valid UTF-8 appear while everything before them was ASCII, is the rest of the input read as\n * windows-1252 (the superset of ISO 8859-1 that Excel, Pajek and older tools write), with the\n * warning W_ENCODING_FALLBACK; invalid UTF-8 after valid non-ASCII UTF-8, in data holding control\n * bytes (binary data), or cut at the end of the input is E_INVALID_UTF8.\n *\n * The decoded text, whatever the input shape, is then checked once: leading U+FEFFs are stripped, a\n * trailing Ctrl-Z (the DOS end-of-file marker) is dropped, the first control character or stray\n * U+FEFF is reported W_CONTROL_CHARACTER, and a text that is empty or only whitespace is the fatal\n * E_EMPTY_INPUT.\n */\n\nimport { GraphFormatError } from \"@graphty/graph-format\";\n\nimport { type ImportInput } from \"../types.js\";\nimport {\n CONTROL_CHARACTER_CODE,\n EMPTY_INPUT_CODE,\n ENCODING_CONFLICT_CODE,\n ENCODING_FALLBACK_CODE,\n FOREIGN_FORMAT_CODE,\n INVALID_ENCODING_CODE,\n INVALID_UTF8_CODE,\n OPTION_IGNORED_CODE,\n TOO_LARGE_CODE,\n UNKNOWN_ENCODING_CODE,\n} from \"./codes.js\";\nimport { type ImportReportBuilder } from \"./report.js\";\n\nexport { INVALID_UTF8_CODE } from \"./codes.js\";\n\n/**\n * Cancellation and progress hooks of the reader; the resolved importer options satisfy this shape.\n * @public\n * @category Plugin helpers\n */\nexport interface ReadOptions {\n /** The cancellation signal, or null / undefined for none. */\n readonly signal?: AbortSignal | null | undefined;\n /** The progress callback, or null / undefined for none. */\n readonly onProgress?: ((bytesDone: number, bytesTotal?: number) => void) | null | undefined;\n /** The caller's `encoding` option (a label TextDecoder knows), or null / undefined for detection. */\n readonly encoding?: string | null | undefined;\n /**\n * The format's reader of a declared encoding: given the head of the input decoded as\n * windows-1252 (ASCII-compatible), the encoding label it declares, or null.\n */\n readonly declaredEncoding?: ((head: string) => string | null) | undefined;\n /** How many leading bytes the declaration reader sees (default 1024). */\n readonly declarationBytes?: number | undefined;\n /**\n * Whether BOM-less UTF-16 that the NUL pattern of its head shows is read in that encoding (JSON:\n * RFC 8259 section 8.1, RFC 4627 section 3) instead of failing with E_INVALID_ENCODING.\n */\n readonly bomlessUtf16?: boolean | undefined;\n /** Whether an input with no text but whitespace is valid (else E_EMPTY_INPUT). */\n readonly allowEmpty?: boolean | undefined;\n /**\n * Whether the format is XML: an (X)HTML document is then left to the format's own root-element\n * check (an XHTML page may embed the format's elements) instead of being E_FOREIGN_FORMAT.\n */\n readonly xml?: boolean | undefined;\n /**\n * Whether a NUL byte in undeclared input fails the import as binary data (or BOM-less UTF-16)\n * even where the bytes are valid UTF-8: for formats whose grammar never reports a NUL itself\n * (CSV). False by default, so a format's own syntax error names it.\n */\n readonly nulIsBinary?: boolean | undefined;\n}\n\n/** How many leading bytes the declaration check sees (an XML prolog, a DOT `charset` near the top). */\nconst HEAD_BYTES = 1024;\n\n/** How many leading bytes the BOM check needs (a UTF-32 mark is four). */\nconst BOM_BYTES = 4;\n\n/**\n * The canonical name of an encoding label, or null when the platform's TextDecoder does not know it.\n * @param label - a WHATWG encoding label (\"latin1\", \"UTF-16LE\", \"cp1252\", ...)\n * @returns the canonical name (\"windows-1252\", \"utf-16le\", ...) or null\n * @category Plugin helpers\n */\nexport function canonicalEncoding(label: string): string | null {\n try {\n return new TextDecoder(label.trim()).encoding;\n } catch {\n return null;\n }\n}\n\n/**\n * The encoding a byte order mark announces. The UTF-32 marks are checked first: FF FE 00 00 is the\n * UTF-32LE mark, not a UTF-16LE one.\n * @param head - the first bytes\n * @returns \"utf-8\", \"utf-16le\", \"utf-16be\", \"utf-32le\", \"utf-32be\" or null\n */\nfunction bomEncoding(head: Uint8Array): string | null {\n if (startsWithBytes(head, [0xff, 0xfe, 0x00, 0x00])) {\n return \"utf-32le\";\n }\n if (startsWithBytes(head, [0x00, 0x00, 0xfe, 0xff])) {\n return \"utf-32be\";\n }\n if (startsWithBytes(head, [0xef, 0xbb, 0xbf])) {\n return \"utf-8\";\n }\n if (startsWithBytes(head, [0xff, 0xfe])) {\n return \"utf-16le\";\n }\n if (startsWithBytes(head, [0xfe, 0xff])) {\n return \"utf-16be\";\n }\n return null;\n}\n\n/**\n * Whether bytes start with a signature.\n * @param bytes - the bytes\n * @param signature - the leading bytes to look for\n * @returns true when every signature byte matches\n */\nfunction startsWithBytes(bytes: Uint8Array, signature: readonly number[]): boolean {\n return bytes.byteLength >= signature.length && signature.every((b, i) => bytes[i] === b);\n}\n\n/**\n * The UTF-16 byte order of a head without a BOM whose every other byte is 0 (ASCII text in UTF-16),\n * or null. At least 90% of the first 512 code units must follow the pattern.\n * @param head - the first bytes\n * @returns \"utf-16le\", \"utf-16be\" or null\n */\nfunction bomlessUtf16(head: Uint8Array): string | null {\n const pairs = Math.min(head.byteLength >> 1, 512);\n if (pairs < 2) {\n return null;\n }\n let le = 0;\n let be = 0;\n for (let i = 0; i < pairs; i++) {\n const even = head[2 * i];\n const odd = head[2 * i + 1];\n if (even !== 0 && odd === 0) {\n le++;\n } else if (even === 0 && odd !== 0) {\n be++;\n }\n }\n if (le >= pairs * 0.9) {\n return \"utf-16le\";\n }\n return be >= pairs * 0.9 ? \"utf-16be\" : null;\n}\n\n/**\n * The UTF-16 byte order of BOM-less UTF-16 input that starts with an XML declaration (XML 1.0\n * Appendix F: `<?` as 3C 00 3F 00 or 00 3C 00 3F).\n * @param head - the first bytes\n * @returns \"utf-16le\", \"utf-16be\" or null\n */\nfunction xmlDeclarationUtf16(head: Uint8Array): string | null {\n if (startsWithBytes(head, [0x3c, 0x00, 0x3f, 0x00])) {\n return \"utf-16le\";\n }\n return startsWithBytes(head, [0x00, 0x3c, 0x00, 0x3f]) ? \"utf-16be\" : null;\n}\n\n/**\n * What a head is when it is a known file type that is no graph format: compressed or archived data,\n * an image, a PDF, an HTML page. Graph formats are text (or, for a Cytoscape session, a zip the\n * registry hands to its own importer), so such an input is never read as text.\n * @param head - the first bytes or characters of the input\n * @returns a description such as \"gzip-compressed data (decompress it first)\", or null\n * @category Plugin helpers\n */\nexport function foreignKind(head: Uint8Array | string): string | null {\n if (typeof head !== \"string\") {\n if (startsWithBytes(head, [0x1f, 0x8b])) {\n return \"gzip-compressed data (decompress it first)\";\n }\n if (startsWithBytes(head, [0x50, 0x4b, 0x03, 0x04]) || startsWithBytes(head, [0x50, 0x4b, 0x05, 0x06])) {\n return \"a zip archive (a Cytoscape session (.cys) is read by the cys importer; extract any other graph file from it first)\";\n }\n if (startsWithBytes(head, [0x89, 0x50, 0x4e, 0x47])) {\n return \"a PNG image\";\n }\n }\n const text = typeof head === \"string\" ? head.slice(0, 64) : String.fromCodePoint(...head.subarray(0, 64));\n const utf8Bom = String.fromCodePoint(0xef, 0xbb, 0xbf);\n let body = text.startsWith(utf8Bom) ? text.slice(3) : text;\n body = body.startsWith(BOM) ? body.slice(1) : body;\n if (body.startsWith(\"%PDF-\")) {\n return \"a PDF document\";\n }\n if (/^\\s*(<!doctype\\s+html[\\s>]|<html[\\s>])/i.test(body)) {\n return \"an HTML document (likely an error page saved in place of the file)\";\n }\n return null;\n}\n\n/**\n * Fail the import with E_FOREIGN_FORMAT when its head is a known non-graph file; an (X)HTML page\n * is left to an XML format's own root-element check.\n * @param head - the first bytes or the first text\n * @param report - the report\n * @param options - whether the format is XML\n */\nfunction refuseForeign(head: Uint8Array | string, report: ImportReportBuilder, options: ReadOptions): void {\n const foreign = foreignKind(head);\n if (foreign !== null && !(options.xml === true && foreign.startsWith(\"an HTML\"))) {\n report.fail(FOREIGN_FORMAT_CODE, `the input is ${foreign}, not ${report.format} text`);\n }\n}\n\n/**\n * Whether two encodings name the same family for a declaration check: equal, or both UTF-16 (a\n * prolog's \"UTF-16\" says nothing about the byte order the BOM gives).\n * @param a - a canonical encoding name\n * @param b - another\n * @returns true when they agree\n */\nfunction sameFamily(a: string, b: string): boolean {\n return a === b || (a.startsWith(\"utf-16\") && b.startsWith(\"utf-16\"));\n}\n\n/**\n * The one byte decoder of an import: picks the encoding from the head (option, BOM, declaration,\n * UTF-8) and decodes strictly, switching to windows-1252 with a warning when undeclared input\n * turns out not to be UTF-8 while everything decoded so far was ASCII.\n */\nclass ByteDecoder {\n private decoder: TextDecoder | null = null;\n\n private encoding = \"utf-8\";\n\n /** Whether a failed UTF-8 decode may switch to windows-1252 (nothing chose UTF-8 explicitly). */\n private mayFallBack = false;\n\n /** Whether every character decoded so far was ASCII (so switching encodings changes no earlier text). */\n private asciiSoFar = true;\n\n /** While asciiSoFar: the bytes the UTF-8 decoder holds back (a sequence split across chunks). */\n private carry: Uint8Array = new Uint8Array(0);\n\n /** Bytes decoded so far, for error positions. */\n private offset = 0;\n\n /** Whether the decoder switched to windows-1252 because undeclared input was not UTF-8. */\n private fellBack = false;\n\n /**\n * The first control byte (other than TAB, LF, FF, CR and a final Ctrl-Z) of undeclared input\n * that may still turn out not to be UTF-8: its offset and value, or null. Tracked from the\n * start of the input, so the binary-data verdict never depends on how the input was chunked.\n */\n private control: { readonly at: number; readonly byte: number } | null = null;\n\n /** The offset of a Ctrl-Z that ended the previous chunk: control data if more bytes follow. */\n private subAt = -1;\n\n /** Set while flushing because a text chunk follows: a sequence cut there is not windows-1252. */\n private textFollows = false;\n\n /** Whether the file declares UTF-8 (read like an undeclared file, but the fallback warning says so). */\n private declaredUtf8 = false;\n\n /** After the windows-1252 fallback: whether later bytes holding valid UTF-8 are still to be reported (once). */\n private mixedPending = false;\n\n /**\n * Create the decoder of one import.\n * @param report - where warnings and the fatal decode error go\n * @param options - the encoding option and the format's declaration reader\n */\n constructor(\n private readonly report: ImportReportBuilder,\n private readonly options: ReadOptions,\n ) {}\n\n /**\n * Whether start() ran.\n * @returns true once the encoding is chosen\n */\n get started(): boolean {\n return this.decoder !== null;\n }\n\n /**\n * Choose the encoding from the first bytes of the input: a BOM, else the option, else the\n * declaration, else UTF-8 (see the module comment), warning where two of them disagree.\n * @param head - the first bytes (up to the declaration size; fewer when the input is shorter)\n */\n start(head: Uint8Array): void {\n refuseForeign(head, this.report, this.options);\n const explicit = this.options.encoding ?? null;\n const bom = bomEncoding(head);\n if (bom === \"utf-32le\" || bom === \"utf-32be\") {\n this.report.fail(\n INVALID_ENCODING_CODE,\n `the input starts with a ${bom.toUpperCase()} byte order mark; UTF-32 is not supported (convert the file to UTF-8)`,\n undefined,\n { byteOffset: 0 },\n );\n }\n if (bom !== null) {\n const option = explicit === null ? null : canonicalEncoding(explicit);\n if (option !== null && option !== bom) {\n this.conflict(`the encoding option says ${option} but the byte order mark says ${bom}; read as ${bom}`);\n }\n this.checkDeclaration(head, bom, \"its byte order mark says\");\n this.use(bom, false);\n return;\n }\n if (explicit !== null) {\n this.use(explicit, false);\n this.checkDeclaration(head, this.encoding, \"the encoding option says\");\n return;\n }\n const xmlUtf16 = xmlDeclarationUtf16(head);\n if (xmlUtf16 !== null) {\n this.checkDeclaration(head, xmlUtf16, \"its XML declaration's byte pattern says\");\n this.use(xmlUtf16, false);\n return;\n }\n const utf16 = bomlessUtf16(head);\n if (utf16 !== null && this.options.bomlessUtf16 === true) {\n this.use(utf16, false);\n return;\n }\n if (utf16 !== null) {\n this.report.fail(\n INVALID_ENCODING_CODE,\n `the input looks like ${utf16} text without a byte order mark (every other byte is 0); pass the encoding option ${JSON.stringify(utf16)} to read it`,\n undefined,\n { byteOffset: 0 },\n );\n }\n const declared = this.declared(head, \"windows-1252\");\n if (declared !== null) {\n const canonical = canonicalEncoding(declared);\n if (canonical === null) {\n this.report.warning(\n \"unsupported\",\n UNKNOWN_ENCODING_CODE,\n `the input declares the encoding ${JSON.stringify(declared)}, which this platform cannot decode; reading it as UTF-8`,\n { element: declared },\n );\n } else if (canonical.startsWith(\"utf-16\")) {\n // a declared UTF-16 over bytes that are not UTF-16 (no BOM, no NUL pattern): the\n // declaration itself was readable as ASCII\n this.conflict(\n `the input declares ${JSON.stringify(declared)} but has no byte order mark and its bytes are not UTF-16; read as UTF-8`,\n );\n } else if (canonical === \"utf-8\") {\n this.declaredUtf8 = true;\n } else {\n // a declared UTF-8 gets the undeclared treatment: tools often write the default\n // prolog over Latin-1 bytes\n this.use(canonical, false);\n return;\n }\n }\n this.use(\"utf-8\", true);\n }\n\n /**\n * The encoding the head declares, read through the format's declaration reader.\n * @param head - the first bytes\n * @param encoding - the encoding to read the head in for the reader\n * @returns the declared label, or null (also for a format without declarations)\n */\n private declared(head: Uint8Array, encoding: string): string | null {\n const reader = this.options.declaredEncoding;\n return reader === undefined ? null : reader(new TextDecoder(encoding).decode(head));\n }\n\n /**\n * Warn when the file declares an encoding other than the one a BOM or the option chose.\n * @param head - the first bytes\n * @param chosen - the encoding the input is read in\n * @param why - what chose it, for the message\n */\n private checkDeclaration(head: Uint8Array, chosen: string, why: string): void {\n const declared = this.declared(head, chosen);\n const canonical = declared === null ? null : canonicalEncoding(declared);\n if (canonical !== null && !sameFamily(canonical, chosen)) {\n this.conflict(\n `the input declares the encoding ${JSON.stringify(declared)} but ${why} ${chosen}; read as ${chosen}`,\n );\n }\n }\n\n /**\n * Record a W_ENCODING_CONFLICT warning.\n * @param message - which sources disagree and which applies\n */\n private conflict(message: string): void {\n this.report.warning(\"coercion\", ENCODING_CONFLICT_CODE, message);\n }\n\n /**\n * Decode the next bytes.\n * @param input - the bytes\n * @param stream - whether more bytes follow\n * @returns the text\n */\n decode(input: Uint8Array, stream: boolean): string {\n // a browser TextDecoder refuses a view of shared memory: decode a private copy\n const bytes =\n typeof SharedArrayBuffer === \"function\" && input.buffer instanceof SharedArrayBuffer\n ? input.slice()\n : input;\n const decoder = this.decoder as TextDecoder;\n if (this.fellBack || (this.mayFallBack && this.asciiSoFar)) {\n this.watch(bytes, !stream);\n if (this.fellBack && this.control !== null) {\n this.binary(this.control);\n }\n }\n const text = this.decodeOrRecover(decoder, bytes, stream);\n if (this.mixedPending) {\n this.reportUtf8After(bytes, this.offset);\n }\n if (this.asciiSoFar && this.mayFallBack) {\n this.trackAscii(bytes, text);\n }\n if (this.mayFallBack && this.options.nulIsBinary === true && text.includes(\"\\0\")) {\n // a NUL never occurs in a text file: undeclared bytes holding one are binary or BOM-less UTF-16\n this.binary({ at: this.offset + bytes.indexOf(0), byte: 0 });\n }\n this.offset += bytes.byteLength;\n return text;\n }\n\n /**\n * Decode bytes, recovering from bytes that are not valid in the encoding.\n * @param decoder - the decoder\n * @param bytes - the bytes\n * @param stream - whether more bytes follow\n * @returns the text\n */\n private decodeOrRecover(decoder: TextDecoder, bytes: Uint8Array, stream: boolean): string {\n try {\n return decoder.decode(bytes, { stream });\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n return this.recover(bytes, stream);\n }\n }\n\n /**\n * Track whether the input is ASCII so far. While it is, every character is one byte, so the\n * bytes not yet emitted are held back for a fallback.\n * @param bytes - the bytes just decoded\n * @param text - their text\n */\n private trackAscii(bytes: Uint8Array, text: string): void {\n if (/[\\u0080-\\uffff]/.test(text)) {\n this.asciiSoFar = false;\n this.carry = new Uint8Array(0);\n return;\n }\n const all = this.carry.byteLength === 0 ? bytes : concatBytes([this.carry, bytes]);\n this.carry = all.slice(text.length);\n }\n\n /**\n * Flush the bytes held back because a text chunk follows (the input switches from bytes to\n * strings): a multi-byte sequence cut there is invalid UTF-8, never windows-1252 text.\n * @param flush - the flush to run (the decoder's own, or the head's)\n * @returns the text of the held-back bytes\n */\n flushBeforeText(flush: () => string): string {\n this.textFollows = true;\n try {\n return flush();\n } finally {\n this.textFollows = false;\n }\n }\n\n /**\n * A decode failed: switch to windows-1252 when allowed, else fail the import with the position\n * of the first byte that is not valid.\n * @param bytes - the bytes that failed\n * @param stream - whether more bytes follow\n * @returns the bytes decoded as windows-1252\n */\n private recover(bytes: Uint8Array, stream: boolean): string {\n const all = this.carry.byteLength === 0 ? bytes : concatBytes([this.carry, bytes]);\n const base = this.offset - this.carry.byteLength;\n const bad = this.encoding === \"utf-8\" ? invalidUtf8(all) : null;\n const at = base + (bad === null ? 0 : bad.index);\n if (this.mayFallBack && this.asciiSoFar) {\n const text = this.fallBack(all, bad, at, base, stream);\n if (text !== null) {\n return text;\n }\n }\n return this.failDecode(bytes, at, base, stream);\n }\n\n /**\n * Undeclared input that was ASCII so far failed to decode: fail on binary data or a cut\n * sequence, else switch to windows-1252 with a warning unless the bytes start with valid\n * non-ASCII UTF-8.\n * @param all - the held-back bytes followed by the bytes that failed\n * @param bad - the first invalid UTF-8 sequence, or null when the encoding is not UTF-8\n * @param at - the byte offset of the first invalid byte\n * @param base - the byte offset of `all`\n * @param stream - whether more bytes follow\n * @returns the bytes decoded as windows-1252, or null when they do not fall back\n */\n private fallBack(\n all: Uint8Array,\n bad: Utf8Problem | null,\n at: number,\n base: number,\n stream: boolean,\n ): string | null {\n // windows-1252 text holds no control bytes but TAB, LF, FF and CR: one anywhere in\n // undeclared input that is not UTF-8 marks binary data (watch() saw every byte so far)\n if (this.control !== null) {\n return this.binary(this.control);\n }\n if (this.textFollows && bad?.cut === true) {\n return this.report.fail(\n INVALID_UTF8_CODE,\n `invalid UTF-8 at byte ${at}: a byte chunk ends inside a multi-byte sequence and a text chunk follows`,\n undefined,\n { byteOffset: at },\n );\n }\n if (!stream && bad?.truncated === true) {\n return this.report.fail(\n INVALID_UTF8_CODE,\n `the input ends in the middle of a UTF-8 sequence at byte ${at} (it may be truncated)`,\n undefined,\n { byteOffset: at },\n );\n }\n if (startsWithUtf8(all)) {\n return null;\n }\n const cutNote =\n !stream && bad?.cut === true ? \": it ends inside a multi-byte UTF-8 sequence, so it may be truncated\" : \"\";\n this.report.warning(\n \"coercion\",\n ENCODING_FALLBACK_CODE,\n this.declaredUtf8\n ? `the input declares UTF-8 but is not valid UTF-8 (at byte ${at}); everything before was ASCII, so it is read as windows-1252 (pass the encoding option to choose another)`\n : `the input is not valid UTF-8 (at byte ${at}${cutNote}) and declares no encoding; read as windows-1252 (pass the encoding option to choose another)`,\n );\n this.use(\"windows-1252\", false);\n this.fellBack = true;\n this.mixedPending = true;\n this.reportUtf8After(all, base);\n return (this.decoder as TextDecoder).decode(all, { stream });\n }\n\n /**\n * Fail the import on bytes that are not valid in the encoding.\n * @param bytes - the bytes that failed\n * @param at - the byte offset of the first invalid UTF-8 byte\n * @param base - the byte offset of the held-back bytes and these\n * @param stream - whether more bytes follow\n * @returns never: it throws\n */\n private failDecode(bytes: Uint8Array, at: number, base: number, stream: boolean): never {\n if (this.encoding === \"utf-8\") {\n const after = this.mayFallBack ? \" after valid non-ASCII UTF-8 text; pass the encoding option\" : \"\";\n return this.report.fail(INVALID_UTF8_CODE, `invalid UTF-8 at byte ${at}${after}`, undefined, {\n byteOffset: at,\n });\n }\n const end = this.offset + bytes.byteLength;\n const odd = !stream && this.encoding.startsWith(\"utf-16\") && end % 2 === 1;\n return this.report.fail(\n INVALID_ENCODING_CODE,\n odd\n ? `the input ends with half a ${this.encoding} code unit at byte ${end - 1} (it may be truncated)`\n : `the bytes near byte ${base} are not valid ${this.encoding}`,\n undefined,\n { byteOffset: odd ? end - 1 : base },\n );\n }\n\n /**\n * After the windows-1252 fallback, report once that later bytes hold a valid multi-byte UTF-8\n * sequence: the input mixes encodings, and those characters are read as two or three\n * windows-1252 characters each.\n * @param bytes - bytes being decoded as windows-1252\n * @param start - the byte offset of the first of them\n */\n private reportUtf8After(bytes: Uint8Array, start: number): void {\n const at = utf8SequenceIndex(bytes);\n if (at < 0) {\n return;\n }\n this.mixedPending = false;\n this.report.warning(\n \"coercion\",\n ENCODING_FALLBACK_CODE,\n `bytes read as windows-1252 hold valid UTF-8 (at byte ${start + at}): the input mixes encodings, and its UTF-8 characters are read as windows-1252 (pass the encoding option to choose one)`,\n );\n }\n\n /**\n * Note the first control byte of the next bytes (see `control`).\n * @param bytes - the bytes, starting at `offset`\n * @param final - whether they end the input\n */\n private watch(bytes: Uint8Array, final: boolean): void {\n if (this.control !== null || bytes.byteLength === 0) {\n return;\n }\n if (this.subAt >= 0) {\n this.control = { at: this.subAt, byte: 0x1a };\n return;\n }\n // a Ctrl-Z at the end of a chunk is held until it is known whether more bytes follow\n const index = controlByte(bytes, true);\n if (index >= 0) {\n this.control = { at: this.offset + index, byte: bytes[index] };\n } else if (!final && bytes[bytes.byteLength - 1] === 0x1a) {\n this.subAt = this.offset + bytes.byteLength - 1;\n }\n }\n\n /**\n * Fail the import as binary data.\n * @param control - the control byte that shows it\n * @param control.at - its offset\n * @param control.byte - its value\n * @returns never\n */\n private binary(control: { readonly at: number; readonly byte: number }): never {\n const hex = control.byte.toString(16).padStart(2, \"0\");\n return this.report.fail(\n INVALID_UTF8_CODE,\n `the input is binary data, not text: control byte 0x${hex} at byte ${control.at}`,\n undefined,\n { byteOffset: control.at },\n );\n }\n\n /**\n * Switch to an encoding.\n * @param label - the encoding label\n * @param mayFallBack - whether a UTF-8 failure may switch to windows-1252\n */\n private use(label: string, mayFallBack: boolean): void {\n this.decoder = new TextDecoder(label, { fatal: true, ignoreBOM: true });\n this.encoding = this.decoder.encoding;\n this.mayFallBack = mayFallBack;\n }\n}\n\n/**\n * Where the first complete, valid multi-byte UTF-8 sequence of some bytes starts.\n * @param bytes - the bytes\n * @returns its index, or -1\n */\nfunction utf8SequenceIndex(bytes: Uint8Array): number {\n for (let i = 0; i < bytes.byteLength; i++) {\n if (bytes[i] >= 0xc2 && isUtf8SequenceAt(bytes, i)) {\n return i;\n }\n }\n return -1;\n}\n\n/**\n * Whether the first non-ASCII byte of a chunk starts a valid UTF-8 sequence: then the chunk holds\n * valid non-ASCII UTF-8 before whatever made it fail, and the input is not windows-1252.\n * @param bytes - a chunk that failed to decode as UTF-8\n * @returns true when its first non-ASCII sequence is valid UTF-8\n */\nfunction startsWithUtf8(bytes: Uint8Array): boolean {\n const i = bytes.findIndex((b) => b >= 0x80);\n return i >= 0 && isUtf8SequenceAt(bytes, i);\n}\n\n/** A strict UTF-8 decoder for checking single sequences (decode() without stream keeps no state). */\nconst STRICT_UTF8 = new TextDecoder(\"utf-8\", { fatal: true });\n\n/**\n * Whether a complete, valid multi-byte UTF-8 sequence starts at an index.\n * @param bytes - the bytes\n * @param i - the index of the lead byte\n * @returns true when the sequence is complete and valid\n */\nfunction isUtf8SequenceAt(bytes: Uint8Array, i: number): boolean {\n const lead = bytes[i];\n let length = 0;\n if (lead >= 0xc2 && lead <= 0xdf) {\n length = 2;\n } else if (lead >= 0xe0 && lead <= 0xef) {\n length = 3;\n } else if (lead >= 0xf0 && lead <= 0xf4) {\n length = 4;\n }\n if (length === 0 || i + length > bytes.byteLength) {\n return false;\n }\n try {\n STRICT_UTF8.decode(bytes.subarray(i, i + length));\n return true;\n } catch {\n return false;\n }\n}\n\n/** The upper half (0x80-0xFF) of code page 437, the zip format's legacy name encoding (APPNOTE appendix D). */\nconst CP437_HIGH: readonly number[] = [\n 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec,\n 0x00c4, 0x00c5, 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, 0x00ff, 0x00d6, 0x00dc, 0x00a2,\n 0x00a3, 0x00a5, 0x20a7, 0x0192, 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, 0x00bf, 0x2310,\n 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,\n 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c,\n 0x255e, 0x255f, 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, 0x2568, 0x2564, 0x2565, 0x2559,\n 0x2558, 0x2552, 0x2553, 0x256b, 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, 0x03b1, 0x00df,\n 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x03c6, 0x03b5, 0x2229,\n 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2,\n 0x25a0, 0x00a0,\n];\n\n/**\n * The first invalid UTF-8 sequence of a chunk (the WHATWG decoder's rules: no overlong forms, no\n * surrogates, nothing above U+10FFFF).\n * @param bytes - the bytes\n * @returns its index, whether it is a valid sequence cut by the end of the bytes (`cut`), and whether\n * that cut sequence holds at least one continuation byte (truncation rather than a stray windows-1252\n * byte); index 0 when none is found\n */\nfunction invalidUtf8(bytes: Uint8Array): Utf8Problem {\n let i = 0;\n while (i < bytes.byteLength) {\n const lead = bytes[i];\n const sequence = lead < 0x80 ? ASCII_SEQUENCE : utf8Sequence(lead);\n if (sequence === null) {\n return { index: i, truncated: false, cut: false };\n }\n const problem = checkContinuation(bytes, i, sequence);\n if (problem !== null) {\n return problem;\n }\n i += sequence.need + 1;\n }\n return { index: 0, truncated: false, cut: false };\n}\n\n/** Where a UTF-8 check stopped, and why. */\ninterface Utf8Problem {\n readonly index: number;\n readonly truncated: boolean;\n readonly cut: boolean;\n}\n\n/** The continuation bytes a UTF-8 lead byte needs, and the range of the first one. */\ninterface Utf8Sequence {\n readonly need: number;\n readonly low: number;\n readonly high: number;\n}\n\nconst ASCII_SEQUENCE: Utf8Sequence = { need: 0, low: 0x80, high: 0xbf };\n\n/**\n * What a UTF-8 lead byte needs after it (no overlong forms, no surrogates, nothing above U+10FFFF).\n * @param lead - the lead byte, 0x80 or above\n * @returns the sequence, or null when the byte cannot lead one\n */\nfunction utf8Sequence(lead: number): Utf8Sequence | null {\n if (lead >= 0xc2 && lead <= 0xdf) {\n return { need: 1, low: 0x80, high: 0xbf };\n }\n if (lead >= 0xe0 && lead <= 0xef) {\n return { need: 2, low: lead === 0xe0 ? 0xa0 : 0x80, high: lead === 0xed ? 0x9f : 0xbf };\n }\n if (lead >= 0xf0 && lead <= 0xf4) {\n return { need: 3, low: lead === 0xf0 ? 0x90 : 0x80, high: lead === 0xf4 ? 0x8f : 0xbf };\n }\n return null;\n}\n\n/**\n * Check the continuation bytes of the sequence led at `i`.\n * @param bytes - the bytes\n * @param i - the lead byte's index\n * @param sequence - what the lead byte needs\n * @returns the problem, or null when the sequence is valid\n */\nfunction checkContinuation(bytes: Uint8Array, i: number, sequence: Utf8Sequence): Utf8Problem | null {\n for (let k = 1; k <= sequence.need; k++) {\n if (i + k >= bytes.byteLength) {\n return { index: i, truncated: k > 1, cut: true };\n }\n const next = bytes[i + k];\n const low = k === 1 ? sequence.low : 0x80;\n const high = k === 1 ? sequence.high : 0xbf;\n if (next < low || next > high) {\n return { index: i, truncated: false, cut: false };\n }\n }\n return null;\n}\n\n/**\n * The first control byte of a chunk that text never holds: below 0x20 but TAB, LF, FF and CR, and\n * not a Ctrl-Z that ends the input (the DOS end-of-file marker).\n * @param bytes - the bytes\n * @param final - whether the bytes end the input\n * @returns its index, or -1\n */\nfunction controlByte(bytes: Uint8Array, final: boolean): number {\n const last = bytes.byteLength - 1;\n // a plain loop: findIndex() with a callback per byte was a measurable share of reading a large file\n for (let i = 0; i <= last; i++) {\n const b = bytes[i];\n if (b < 0x20 && b !== 0x09 && b !== 0x0a && b !== 0x0c && b !== 0x0d && !(b === 0x1a && final && i === last)) {\n return i;\n }\n }\n return -1;\n}\n\n/**\n * A zip entry name as text (APPNOTE 4.4.17 and appendix D): UTF-8 when the bytes are valid UTF-8,\n * whether or not the entry sets the language-encoding flag (bit 11); otherwise code page 437 when\n * the flag is clear (what Windows and older tools write), and windows-1252 when the entry claims\n * UTF-8 (or no flags are known). Never throws: a name is a matching key, never a path, so an\n * undecodable one still has to name its entry.\n * @param bytes - the name bytes from the central directory or a local header\n * @param cp437 - the entry's bit 11 is clear: decode a non-UTF-8 name as code page 437\n * @returns the name\n * @category Plugin helpers\n */\nexport function decodeEntryName(bytes: Uint8Array, cp437 = false): string {\n try {\n return new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true }).decode(bytes);\n } catch {\n if (!cp437) {\n return new TextDecoder(\"windows-1252\").decode(bytes);\n }\n let out = \"\";\n for (const byte of bytes) {\n out += String.fromCodePoint(byte < 0x80 ? byte : CP437_HIGH[byte - 0x80]);\n }\n return out;\n }\n}\n\n/**\n * Join byte chunks.\n * @param chunks - the chunks\n * @returns one array holding them in order\n */\nfunction concatBytes(chunks: readonly Uint8Array[]): Uint8Array {\n if (chunks.length === 1) {\n return chunks[0];\n }\n const out = new Uint8Array(chunks.reduce((sum, c) => sum + c.byteLength, 0));\n let offset = 0;\n for (const chunk of chunks) {\n out.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return out;\n}\n\n/**\n * Bytes decoded per call when the input is one in-memory Uint8Array, and characters per chunk of a\n * string input: every consumer of textChunks() then sees bounded chunks whatever the input shape (a\n * line reader or a record reader that holds one parse result per chunk never holds more than this\n * much text at once), and progress stays granular.\n */\nconst DECODE_SLICE = 256 * 1024;\n\nconst BOM = String.fromCharCode(0xfeff);\n\n/** The DOS end-of-file marker, Ctrl-Z. */\nconst SUB = String.fromCodePoint(0x1a);\n\n/**\n * The longest string V8 makes (2^29 - 24 UTF-16 code units); longer text cannot be one string.\n * @category Plugin helpers\n */\nexport const MAX_TEXT_LENGTH = 2 ** 29 - 24;\n\n/**\n * A character text keeps only by accident: a C0 control but TAB, LF, FF and CR, DEL, a C1 control\n * (also what windows-1252 bytes it leaves undefined decode to), and U+FEFF inside the text.\n */\nconst CONTROL_CHARACTER = new RegExp(\n `[${String.fromCodePoint(0x00)}-${String.fromCodePoint(0x08, 0x0b, 0x0e)}-${String.fromCodePoint(0x1f, 0x7f)}-${String.fromCodePoint(0x9f)}${BOM}]`,\n);\n\n/**\n * Whether a value is an ImportInput this module can read.\n * @param input - any value\n * @returns true for a string, a Uint8Array, a ReadableStream or an async iterable\n * @category Plugin helpers\n */\nexport function isImportInput(input: unknown): input is ImportInput {\n if (typeof input === \"string\" || asBytes(input) !== null) {\n return true;\n }\n if (typeof input !== \"object\" || input === null) {\n return false;\n }\n return typeof (input as { getReader?: unknown }).getReader === \"function\" || Symbol.asyncIterator in input;\n}\n\n/**\n * A Uint8Array, also one from another realm (a vm context, an iframe), as a Uint8Array of this one.\n * @param value - any value\n * @returns the bytes, or null when the value is not a Uint8Array\n */\nfunction asBytes(value: unknown): Uint8Array | null {\n if (value instanceof Uint8Array) {\n return value;\n }\n if (ArrayBuffer.isView(value) && Object.prototype.toString.call(value) === \"[object Uint8Array]\") {\n return new Uint8Array(value.buffer, value.byteOffset, value.byteLength);\n }\n return null;\n}\n\n/**\n * The input as one of the ImportInput shapes, or E_UNSUPPORTED naming what was passed and how to\n * pass it instead (an ArrayBuffer, a Blob, a fetch Response, null from a failed read).\n * @param input - what the caller passed\n * @returns the input (a Uint8Array from another realm re-viewed in this one)\n * @category Plugin helpers\n */\nexport function normalizeInput(input: unknown): ImportInput {\n if (typeof input === \"string\") {\n return input;\n }\n const bytes = asBytes(input);\n if (bytes !== null) {\n return bytes;\n }\n if (isImportInput(input)) {\n return input;\n }\n const tag = Object.prototype.toString.call(input).slice(8, -1);\n let found: string = input === null ? \"null\" : typeof input;\n let fix = \"\";\n if (tag === \"ArrayBuffer\" || tag === \"SharedArrayBuffer\") {\n found = `an ${tag}`;\n fix = \"; wrap it as new Uint8Array(buffer)\";\n } else if (ArrayBuffer.isView(input)) {\n found = `a ${tag}`;\n fix = \"; pass new Uint8Array(view.buffer, view.byteOffset, view.byteLength)\";\n } else if (typeof input === \"object\" && input !== null) {\n const object = input as { stream?: unknown; size?: unknown; body?: unknown; arrayBuffer?: unknown };\n if (typeof object.stream === \"function\" && typeof object.size === \"number\") {\n found = \"a Blob or File\";\n fix = \"; pass blob.stream()\";\n } else if (\"body\" in object && typeof object.arrayBuffer === \"function\") {\n found = \"a fetch Response\";\n fix = \"; pass response.body\";\n } else {\n found = `an object (${tag})`;\n }\n }\n throw new GraphFormatError(\n \"E_UNSUPPORTED\",\n `the input is ${found}; an importer reads a string, a Uint8Array, a ReadableStream or an async iterable of strings and Uint8Arrays${fix}`,\n { reason: \"input type\", found },\n );\n}\n\n/**\n * The total size of an in-memory input (bytes for a Uint8Array, UTF-16 code units for a string),\n * null for a stream or an iterable.\n * @param input - the input\n * @returns the size, or null when unknown up front\n * @category Plugin helpers\n */\nexport function inputLength(input: ImportInput): number | null {\n if (typeof input === \"string\") {\n return input.length;\n }\n if (input instanceof Uint8Array) {\n return input.byteLength;\n }\n return null;\n}\n\n/**\n * The UTF-8 length of a text, the unit onProgress counts text in (a lone surrogate counts as the\n * three bytes of U+FFFD).\n * @param text - the text\n * @returns its length in UTF-8 bytes\n */\nfunction utf8Length(text: string): number {\n let bytes = 0;\n let i = 0;\n while (i < text.length) {\n const c = text.charCodeAt(i); // NOSONAR(S7758): reads UTF-16 code units on purpose\n const pair = c >= 0xd800 && c <= 0xdbff && (text.charCodeAt(i + 1) & 0xfc00) === 0xdc00; // NOSONAR(S7758): reads UTF-16 code units on purpose\n if (c < 0x80) {\n bytes++;\n } else if (c < 0x800) {\n bytes += 2;\n } else {\n bytes += pair ? 4 : 3;\n }\n i += pair ? 2 : 1;\n }\n return bytes;\n}\n\n/**\n * Throw the signal's reason when it is aborted, exactly as the platform's\n * `AbortSignal.throwIfAborted()` does: the reason as it is (the DOMException named \"AbortError\"\n * of a reason-less abort, or whatever the caller passed to `abort(reason)`, an Error or not), so a\n * caller can compare the rejection with `signal.reason`. Only a runtime that stores no reason at\n * all gets a synthesized AbortError.\n * @param signal - the signal, or null\n * @category Writing a format\n */\nexport function throwIfAborted(signal: AbortSignal | null | undefined): void {\n if (!signal?.aborted) {\n return;\n }\n const { reason }: { reason: unknown } = signal;\n if (reason === undefined) {\n throw abortError();\n }\n // the platform contract: the reason itself, whatever its type\n throw reason as Error; // NOSONAR(S3696): rethrows the abort signal's reason, as the platform does\n}\n\n/**\n * An abort error for a signal that carries no reason.\n * @returns a DOMException named \"AbortError\" where DOMException exists, else an Error with that name\n */\nfunction abortError(): Error {\n const message = \"The import was aborted\";\n if (typeof DOMException === \"function\") {\n return new DOMException(message, \"AbortError\");\n }\n const err = new Error(message);\n err.name = \"AbortError\";\n return err;\n}\n\n/**\n * A promise that also settles when the signal fires, rejecting with its reason: a read that stalls\n * (a network body that never delivers) cannot keep an aborted import pending. The caller checks\n * the signal before calling.\n * @param promise - the pending operation\n * @param signal - the cancellation signal, or null\n * @returns the operation's result, or the abort reason as a rejection\n * @category Plugin helpers\n */\nexport function abortable<T>(promise: Promise<T>, signal: AbortSignal | null): Promise<T> {\n if (signal === null || typeof signal.addEventListener !== \"function\") {\n return promise;\n }\n return new Promise<T>((resolve, reject) => {\n const onAbort = (): void => {\n try {\n throwIfAborted(signal);\n } catch (err) {\n reject(err);\n }\n };\n signal.addEventListener(\"abort\", onAbort, { once: true });\n promise.then(\n (value) => {\n signal.removeEventListener(\"abort\", onAbort);\n resolve(value);\n },\n (err: unknown) => {\n signal.removeEventListener(\"abort\", onAbort);\n reject(err);\n },\n );\n });\n}\n\n/**\n * A reader of a stream, or E_UNSUPPORTED when another reader holds the stream already.\n * @param stream - the stream\n * @returns the reader\n * @category Plugin helpers\n */\nexport function lockReader(stream: ReadableStream<Uint8Array>): ReadableStreamDefaultReader<Uint8Array> {\n if (stream.locked) {\n throw new GraphFormatError(\n \"E_UNSUPPORTED\",\n \"the input ReadableStream is locked: another reader holds it (release it, or pass a fresh stream)\",\n { reason: \"stream locked\" },\n );\n }\n return stream.getReader();\n}\n\n/**\n * The checks every decoded text passes once, whatever the input shape: leading U+FEFFs stripped,\n * a known non-graph document (HTML, PDF) refused, a trailing Ctrl-Z held back and dropped at the\n * end, the first control character reported, and an input with no text but whitespace refused.\n */\nclass TextFilter {\n private first = true;\n\n private content = false;\n\n private heldSub = false;\n\n private warned = false;\n\n private strayBom = false;\n\n /**\n * Create the filter of one import.\n * @param report - where the warnings and the fatal errors go\n * @param options - whether an empty input is valid, whether the format is XML\n */\n constructor(\n private readonly report: ImportReportBuilder,\n private readonly options: ReadOptions,\n ) {}\n\n /**\n * Filter the next decoded text.\n * @param chunk - the text\n * @returns the text to hand on\n */\n push(chunk: string): string {\n let text = this.heldSub ? SUB + chunk : chunk;\n this.heldSub = false;\n if (text.length === 0) {\n return text;\n }\n if (this.first) {\n text = this.skipByteOrderMarks(text);\n if (text.length === 0) {\n return text;\n }\n this.first = false;\n // ponytail: only the first non-empty chunk is checked, so a document arriving one\n // character per chunk is not recognized; the parser then fails on it instead\n refuseForeign(text, this.report, this.options);\n }\n if (text.endsWith(SUB)) {\n this.heldSub = true;\n text = text.slice(0, -1);\n }\n if (!this.content && /\\S/.test(text)) {\n this.content = true;\n }\n if (!this.warned) {\n this.warnControl(text);\n }\n return text;\n }\n\n /**\n * Drop the byte order marks the input starts with, warning when there is more than one.\n * @param text - the first text\n * @returns the text without them\n */\n private skipByteOrderMarks(text: string): string {\n let start = 0;\n while (text.codePointAt(start) === 0xfeff) {\n start++;\n }\n if (start > 1 && !this.strayBom) {\n // the first U+FEFF is the byte order mark; another one is a stray character\n this.strayBom = true;\n this.report.warning(\n \"validation-error\",\n CONTROL_CHARACTER_CODE,\n `the input starts with ${start} byte order marks (U+FEFF); the extra ones were ignored`,\n { element: \"U+FEFF\" },\n );\n }\n return text.slice(start);\n }\n\n /**\n * Warn, once, about the first control character the text holds.\n * @param text - the text\n */\n private warnControl(text: string): void {\n const match = CONTROL_CHARACTER.exec(text);\n if (match === null) {\n return;\n }\n this.warned = true;\n const code = (match[0].codePointAt(0) ?? 0).toString(16).toUpperCase().padStart(4, \"0\");\n const around = JSON.stringify(text.slice(Math.max(0, match.index - 20), match.index + 20));\n this.report.warning(\n \"validation-error\",\n CONTROL_CHARACTER_CODE,\n `the input holds the control character U+${code} (in ${around}); it is kept in the id or value it is part of`,\n { element: `U+${code}` },\n );\n }\n\n /** The input ended: drop a held Ctrl-Z with a warning, and refuse an input without content. */\n end(): void {\n if (this.heldSub) {\n this.report.warning(\n \"validation-error\",\n CONTROL_CHARACTER_CODE,\n \"the input ends with a Ctrl-Z (0x1A), the DOS end-of-file marker; it was ignored\",\n { element: \"U+001A\" },\n );\n }\n if (!this.content && this.options.allowEmpty !== true) {\n this.report.fail(EMPTY_INPUT_CODE, this.first ? \"the input is empty\" : \"the input holds only whitespace\");\n }\n }\n}\n\n/**\n * Record W_OPTION_IGNORED for an encoding option given with text input, which is already decoded.\n * @param report - the report\n * @param encoding - the option, or null / undefined\n */\nfunction reportTextEncoding(report: ImportReportBuilder, encoding: string | null | undefined): void {\n if (encoding !== null && encoding !== undefined) {\n report.warning(\n \"unsupported\",\n OPTION_IGNORED_CODE,\n \"option encoding has no effect on text input, which is already decoded\",\n { element: \"encoding\" },\n );\n }\n}\n\n/**\n * Read an ImportInput as a sequence of decoded text chunks. Chunk boundaries carry no meaning:\n * a caller that needs lines uses LineReader, one that needs the whole document uses readText().\n * The signal is checked before every chunk and while a stream read is pending; a stream is\n * canceled when the consumer stops early or the signal fires. Progress is reported after every\n * chunk, in bytes (text counted as UTF-8).\n * @param rawInput - the input\n * @param report - the report decode errors and the text checks are recorded in (E_INVALID_UTF8,\n * E_EMPTY_INPUT, ... then ImportError)\n * @param options - cancellation, progress and the encoding\n * @yields decoded text; leading BOMs and a trailing Ctrl-Z removed\n * @returns nothing\n * @category Writing a format\n */\nexport async function* textChunks(\n rawInput: ImportInput,\n report: ImportReportBuilder,\n options: ReadOptions = {},\n): AsyncGenerator<string, void, undefined> {\n const input = normalizeInput(rawInput);\n const signal = options.signal ?? null;\n const filter = new TextFilter(report, options);\n throwIfAborted(signal);\n if (typeof input === \"string\") {\n reportTextEncoding(report, options.encoding);\n yield* stringTextChunks(input, filter, options);\n return;\n }\n const decoder = new ByteDecoder(report, options);\n if (input instanceof Uint8Array) {\n yield* byteTextChunks(input, filter, decoder, options);\n return;\n }\n // the stream's loop stays here rather than in a delegated generator: a yield* layer costs\n // time on every chunk, and a stream may arrive in many small ones\n const stream = new StreamText(filter, decoder, options);\n for await (const chunk of isReadableStream(input) ? streamChunks(input, signal) : input) {\n throwIfAborted(signal);\n const text = stream.push(chunk);\n if (text.length > 0) {\n yield text;\n }\n options.onProgress?.(stream.done);\n }\n const tail = stream.end();\n if (tail.length > 0) {\n yield tail;\n }\n filter.end();\n options.onProgress?.(stream.done, stream.done);\n}\n\n/**\n * The end of the slice of a string input that starts at start: DECODE_SLICE code units, one more\n * when the slice would end between the two halves of a surrogate pair.\n * @param input - the string\n * @param start - where the slice starts\n * @returns where it ends\n */\nfunction stringSliceEnd(input: string, start: number): number {\n const end = Math.min(start + DECODE_SLICE, input.length);\n const highSurrogate = (input.charCodeAt(end - 1) & 0xfc00) === 0xd800; // NOSONAR(S7758): reads UTF-16 code units on purpose\n return end < input.length && highSurrogate ? end + 1 : end;\n}\n\n/**\n * textChunks() of a string input: slices of it, through the text filter.\n * @param input - the string\n * @param filter - the text checks\n * @param options - cancellation and progress\n * @yields the filtered slices\n * @returns nothing\n */\nfunction* stringTextChunks(\n input: string,\n filter: TextFilter,\n options: ReadOptions,\n): Generator<string, void, undefined> {\n const signal = options.signal ?? null;\n const onProgress = options.onProgress ?? null;\n const total = onProgress === null ? 0 : utf8Length(input);\n let done = 0;\n let start = 0;\n while (start < input.length) {\n throwIfAborted(signal);\n const end = stringSliceEnd(input, start);\n const piece = start === 0 && end === input.length ? input : input.slice(start, end);\n start = end;\n const text = filter.push(piece);\n if (text.length > 0) {\n yield text;\n }\n if (onProgress !== null) {\n done += utf8Length(piece);\n onProgress(done, total);\n }\n }\n if (input.length === 0) {\n onProgress?.(0, 0);\n }\n filter.end();\n}\n\n/**\n * textChunks() of a Uint8Array input: slices of it, decoded, through the text filter.\n * @param input - the bytes\n * @param filter - the text checks\n * @param decoder - the byte decoder\n * @param options - cancellation, progress and the declaration size\n * @yields the decoded, filtered slices\n * @returns nothing\n */\nfunction* byteTextChunks(\n input: Uint8Array,\n filter: TextFilter,\n decoder: ByteDecoder,\n options: ReadOptions,\n): Generator<string, void, undefined> {\n const signal = options.signal ?? null;\n const length = input.byteLength;\n decoder.start(input.subarray(0, headByteCount(options)));\n for (let offset = 0; offset < length; offset += DECODE_SLICE) {\n throwIfAborted(signal);\n if (input.byteLength !== length) {\n throw new GraphFormatError(\n \"E_UNSUPPORTED\",\n \"the input's buffer was detached (transferred) or resized during the import\",\n { reason: \"detached\" },\n );\n }\n const slice = input.subarray(offset, Math.min(offset + DECODE_SLICE, length));\n const text = filter.push(decoder.decode(slice, offset + DECODE_SLICE < length));\n if (text.length > 0) {\n yield text;\n }\n options.onProgress?.(Math.min(offset + DECODE_SLICE, length), length);\n }\n if (length === 0) {\n options.onProgress?.(0, 0);\n }\n filter.end();\n}\n\n/**\n * How many leading bytes the encoding is chosen from: the format's declaration size, at least a BOM.\n * @param options - the declaration size\n * @returns the byte count\n */\nfunction headByteCount(options: ReadOptions): number {\n return Math.max(options.declarationBytes ?? HEAD_BYTES, BOM_BYTES);\n}\n\n/**\n * The chunks of a stream input (a ReadableStream or an async iterable of strings and bytes) turned\n * into filtered text. The first bytes are held back until the BOM check (and the declaration\n * check, when the format has one) can see enough of them, or the input ended, or text arrived, so\n * a BOM or a declaration split across small chunks is still seen.\n */\nclass StreamText {\n /** Bytes read so far (text counted as UTF-8 when progress is reported), for progress. */\n done = 0;\n\n private head: Uint8Array[] = [];\n\n private headLength = 0;\n\n private readonly headBytes: number;\n\n /** How many bytes to hold back before choosing the encoding. */\n private readonly needed: number;\n\n /** Whether progress is reported, so text chunks are measured. */\n private readonly counting: boolean;\n\n /**\n * Create the reader of one stream input.\n * @param filter - the text checks\n * @param decoder - the byte decoder\n * @param options - progress, the declaration reader and its size\n */\n constructor(\n private readonly filter: TextFilter,\n private readonly decoder: ByteDecoder,\n options: ReadOptions,\n ) {\n this.headBytes = headByteCount(options);\n this.needed = options.declaredEncoding === undefined ? BOM_BYTES : this.headBytes;\n this.counting = (options.onProgress ?? null) !== null;\n }\n\n /**\n * Read the next chunk.\n * @param chunk - a string or a Uint8Array (anything else is E_UNSUPPORTED)\n * @returns its filtered text; empty while bytes are held back\n */\n push(chunk: unknown): string {\n if (typeof chunk === \"string\") {\n this.done += this.counting ? utf8Length(chunk) : 0;\n return this.filter.push(this.beforeText() + chunk);\n }\n const bytes = asBytes(chunk);\n if (bytes === null) {\n throw new GraphFormatError(\"E_UNSUPPORTED\", \"an input chunk must be a string or a Uint8Array\", {\n reason: \"chunk type\",\n found: typeof chunk,\n });\n }\n this.done += bytes.byteLength;\n if (this.decoder.started) {\n return this.filter.push(this.decoder.decode(bytes, true));\n }\n this.head.push(bytes);\n this.headLength += bytes.byteLength;\n return this.headLength >= this.needed ? this.filter.push(this.flushHead(true)) : \"\";\n }\n\n /**\n * The input ended: the filtered text of whatever is still held or pending.\n * @returns the text\n */\n end(): string {\n let tail = \"\";\n if (this.headLength > 0) {\n tail = this.flushHead(false);\n } else if (this.decoder.started) {\n tail = this.decoder.decode(new Uint8Array(0), false);\n }\n return this.filter.push(tail);\n }\n\n /**\n * Start the decoder on the held bytes and decode them.\n * @param stream - whether more bytes follow\n * @returns their text\n */\n private flushHead(stream: boolean): string {\n const bytes = concatBytes(this.head);\n this.head = [];\n this.headLength = 0;\n this.decoder.start(bytes.subarray(0, this.headBytes));\n return this.decoder.decode(bytes, stream);\n }\n\n /**\n * A text chunk follows: finish any byte sequence still pending in the decoder before switching\n * to text. The BOM and declaration checks apply to the start of the input only, so bytes after\n * text are never taken for a BOM.\n * @returns the text of the pending bytes\n */\n private beforeText(): string {\n if (this.headLength > 0) {\n return this.decoder.flushBeforeText(() => this.flushHead(false));\n }\n if (this.decoder.started) {\n return this.decoder.flushBeforeText(() => this.decoder.decode(new Uint8Array(0), false));\n }\n this.decoder.start(new Uint8Array(0));\n return \"\";\n }\n}\n\n/**\n * Whether an input is a ReadableStream (by duck type, so a stream from another realm qualifies).\n * @param input - a non-string, non-Uint8Array input\n * @returns true for a ReadableStream\n */\nfunction isReadableStream(\n input: ReadableStream<Uint8Array> | AsyncIterable<string | Uint8Array>,\n): input is ReadableStream<Uint8Array> {\n return typeof (input as { getReader?: unknown }).getReader === \"function\";\n}\n\n/**\n * Iterate a ReadableStream through a reader, cancelling the stream (with the signal's reason) when\n * iteration stops early or the signal fires, also while a read is pending.\n * @param stream - the stream\n * @param signal - the cancellation signal, or null\n * @yields the stream's chunks\n * @returns nothing\n */\nasync function* streamChunks(\n stream: ReadableStream<Uint8Array>,\n signal: AbortSignal | null,\n): AsyncGenerator<Uint8Array, void, undefined> {\n const reader = lockReader(stream);\n let finished = false;\n try {\n for (;;) {\n throwIfAborted(signal);\n const { done, value } = await abortable(reader.read(), signal);\n if (done) {\n finished = true;\n return;\n }\n yield value;\n }\n } finally {\n if (!finished) {\n await reader.cancel(signal?.reason).catch(() => undefined);\n }\n reader.releaseLock();\n }\n}\n\n/**\n * Read the whole input as bytes, for a binary format (a zip): nothing is decoded. The signal is\n * checked before every chunk and progress reported after it; a stream is canceled when the read\n * stops early.\n * @param rawInput - the input\n * @param options - cancellation and progress (the encoding is ignored)\n * @returns the bytes, or null when the input is text (a string, or a chunk that is a string),\n * which a binary format cannot read\n */\nexport async function readBytes(rawInput: ImportInput, options: ReadOptions = {}): Promise<Uint8Array | null> {\n const input = normalizeInput(rawInput);\n const signal = options.signal ?? null;\n throwIfAborted(signal);\n if (typeof input === \"string\") {\n return null;\n }\n if (input instanceof Uint8Array) {\n options.onProgress?.(input.byteLength, input.byteLength);\n return input;\n }\n const parts: Uint8Array[] = [];\n let done = 0;\n for await (const chunk of isReadableStream(input) ? streamChunks(input, signal) : input) {\n throwIfAborted(signal);\n if (typeof chunk === \"string\") {\n return null;\n }\n const bytes = asBytes(chunk);\n if (bytes === null) {\n throw new GraphFormatError(\"E_UNSUPPORTED\", \"an input chunk must be a string or a Uint8Array\", {\n reason: \"chunk type\",\n found: typeof chunk,\n });\n }\n parts.push(bytes);\n done += bytes.byteLength;\n options.onProgress?.(done);\n }\n options.onProgress?.(done, done);\n return parts.length === 0 ? new Uint8Array(0) : concatBytes(parts);\n}\n\n/**\n * Fail an import whose text is longer than one JavaScript string can hold.\n * @param report - the report\n * @param message - what is too long\n * @param line - the line, when known\n * @category Plugin helpers\n */\nexport function tooLarge(report: ImportReportBuilder, message: string, line?: number): never {\n report.failWith(\"unsupported\", TOO_LARGE_CODE, message, line === undefined ? undefined : { line });\n}\n\n/**\n * Read the whole input as one string (what the GML, DOT and JSON importers do), failing with\n * E_TOO_LARGE (category unsupported) before the join when it is longer than one JavaScript string\n * can hold. A string input is used as it is (one progress call), after the same text checks.\n * @param rawInput - the input\n * @param report - the report the decode error is recorded in\n * @param options - cancellation and progress\n * @returns the decoded text without a leading BOM or a trailing Ctrl-Z\n * @category Writing a format\n */\nexport async function readText(\n rawInput: ImportInput,\n report: ImportReportBuilder,\n options: ReadOptions = {},\n): Promise<string> {\n const input = normalizeInput(rawInput);\n if (typeof input === \"string\") {\n throwIfAborted(options.signal);\n reportTextEncoding(report, options.encoding);\n const filter = new TextFilter(report, options);\n const text = filter.push(input);\n filter.end();\n if (options.onProgress !== null && options.onProgress !== undefined) {\n const total = utf8Length(input);\n options.onProgress(total, total);\n }\n return text;\n }\n const parts: string[] = [];\n let length = 0;\n for await (const chunk of textChunks(input, report, options)) {\n length += chunk.length;\n if (length > MAX_TEXT_LENGTH) {\n tooLarge(\n report,\n `the document is longer than ${MAX_TEXT_LENGTH} characters, the most one JavaScript string holds`,\n );\n }\n parts.push(chunk);\n }\n return parts.length === 1 ? parts[0] : parts.join(\"\");\n}\n\n/**\n * Lines of an ImportInput without allocating anything per line but the string itself: iterate with\n * `for await (const text of reader)` and read `reader.line` (1-based) for the line just yielded.\n * `\\n`, `\\r\\n` and lone `\\r` all end a line; the terminator is not part of the text; a final\n * line without a terminator is yielded when non-empty, and every line in between is yielded even\n * when empty (the importer decides what a blank line means).\n * @category Writing a format\n */\nexport class LineReader implements AsyncIterable<string> {\n private readonly input: ImportInput;\n\n private readonly report: ImportReportBuilder;\n\n private readonly options: ReadOptions;\n\n private lineNumber = 0;\n\n /**\n * Create a reader over an input; nothing is read until iteration starts.\n * @param input - the input\n * @param report - the report decode errors are recorded in\n * @param options - cancellation and progress\n */\n constructor(input: ImportInput, report: ImportReportBuilder, options: ReadOptions = {}) {\n this.input = input;\n this.report = report;\n this.options = options;\n }\n\n /**\n * The 1-based number of the line most recently yielded.\n * @returns the line number; 0 before the first line\n */\n get line(): number {\n return this.lineNumber;\n }\n\n /**\n * The E_TOO_LARGE message of a line longer than one string.\n * @returns the message\n */\n private lineTooLong(): string {\n return `a line is longer than ${MAX_TEXT_LENGTH} characters, the most one JavaScript string holds`;\n }\n\n /**\n * Iterate the lines.\n * @yields one line at a time, terminator removed\n * @returns nothing\n */\n async *[Symbol.asyncIterator](): AsyncGenerator<string, void, undefined> {\n // The pieces of the line in progress, joined once when the line ends, so a line spanning\n // many chunks costs its length, not its length times the chunk count.\n const pending = new PendingLine((line) => tooLarge(this.report, this.lineTooLong(), line));\n let trailingCr = false;\n for await (const chunk of textChunks(this.input, this.report, this.options)) {\n let start = 0;\n if (trailingCr) {\n // the previous chunk ended with `\\r`: that ended a line, and a leading `\\n` here is\n // the second half of the same terminator\n trailingCr = false;\n this.lineNumber++;\n yield pending.take().slice(0, -1);\n if (chunk.charCodeAt(0) === 10) {\n start = 1;\n }\n }\n const breaks = new LineBreaks(chunk, start);\n while (breaks.advance()) {\n this.lineNumber++;\n yield pending.finish(chunk.slice(start, breaks.cut), this.lineNumber);\n start = breaks.next;\n }\n if (start < chunk.length) {\n pending.appendRest(chunk, start, this.lineNumber + 1);\n trailingCr = chunk.codePointAt(chunk.length - 1) === 13;\n }\n }\n if (!pending.empty) {\n this.lineNumber++;\n const joined = pending.take();\n yield joined.endsWith(\"\\r\") ? joined.slice(0, -1) : joined;\n }\n }\n}\n\n/**\n * The pieces of a line that spans chunks. None of them holds a line break, except that the last\n * may end with a `\\r` whose meaning the next chunk decides.\n */\nclass PendingLine {\n private readonly pieces: string[] = [];\n\n private length = 0;\n\n private readonly tooLong: (line: number) => never;\n\n /**\n * Start an empty line.\n * @param tooLong - fails the import when the line grows longer than one string can hold\n */\n constructor(tooLong: (line: number) => never) {\n this.tooLong = tooLong;\n }\n\n /**\n * Whether no piece is held.\n * @returns true when the line in progress is empty\n */\n get empty(): boolean {\n return this.pieces.length === 0;\n }\n\n /**\n * Hold the rest of a chunk from `start`: the line goes on in the next chunk.\n * @param chunk - the chunk\n * @param start - where the unfinished line starts in it\n * @param line - the 1-based number of the line, for the too-long error\n */\n appendRest(chunk: string, start: number, line: number): void {\n this.append(start === 0 ? chunk : chunk.slice(start), line);\n }\n\n /**\n * End the line with its last piece.\n * @param piece - the text from the start of the chunk (or the last break) to the line break\n * @param line - the 1-based number of the line, for the too-long error\n * @returns the whole line\n */\n finish(piece: string, line: number): string {\n if (this.pieces.length === 0) {\n return piece;\n }\n this.append(piece, line);\n return this.take();\n }\n\n /**\n * Join the held pieces and start a new line.\n * @returns the joined text\n */\n take(): string {\n const joined = this.pieces.join(\"\");\n this.pieces.length = 0;\n this.length = 0;\n return joined;\n }\n\n /**\n * Hold one more piece.\n * @param piece - the piece\n * @param line - the 1-based number of the line, for the too-long error\n */\n private append(piece: string, line: number): void {\n this.length += piece.length;\n if (this.length > MAX_TEXT_LENGTH) {\n this.tooLong(line);\n }\n this.pieces.push(piece);\n }\n}\n\n/**\n * The line breaks of one chunk, in order: `\\n`, `\\r\\n` and a lone `\\r`. Each of `\\n` and `\\r` is\n * searched for once per chunk and again only after it was consumed, so a chunk is scanned once\n * whatever its line count.\n */\nclass LineBreaks {\n /** Where the line just found ends (its terminator starts there). */\n cut = 0;\n\n /** Where the next line starts. */\n next: number;\n\n private readonly chunk: string;\n\n private nl: number;\n\n private cr: number;\n\n /**\n * Scan a chunk from a position.\n * @param chunk - the chunk\n * @param start - where scanning starts\n */\n constructor(chunk: string, start: number) {\n this.chunk = chunk;\n this.next = start;\n this.nl = chunk.indexOf(\"\\n\", start);\n this.cr = chunk.indexOf(\"\\r\", start);\n }\n\n /**\n * Find the next line break.\n * @returns false when none is left, or the only one left is a trailing `\\r` (it may be the first\n * half of a `\\r\\n` split across chunks)\n */\n advance(): boolean {\n const { chunk, next } = this;\n if (this.nl >= 0 && this.nl < next) {\n this.nl = chunk.indexOf(\"\\n\", next);\n }\n if (this.cr >= 0 && this.cr < next) {\n this.cr = chunk.indexOf(\"\\r\", next);\n }\n const { nl, cr } = this;\n if (cr >= 0 && (nl < 0 || cr < nl)) {\n if (cr === chunk.length - 1) {\n return false;\n }\n this.cut = cr;\n this.next = chunk.codePointAt(cr + 1) === 10 ? cr + 2 : cr + 1;\n return true;\n }\n if (nl < 0) {\n return false;\n }\n this.cut = nl;\n this.next = nl + 1;\n return true;\n }\n}\n"],"names":[],"mappings":";;AAoFA,MAAM,aAAa;AAGnB,MAAM,YAAY;AAQX,SAAS,kBAAkB,OAA8B;AAC5D,MAAI;AACA,WAAO,IAAI,YAAY,MAAM,KAAA,CAAM,EAAE;AAAA,EACzC,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AAQA,SAAS,YAAY,MAAiC;AAClD,MAAI,gBAAgB,MAAM,CAAC,KAAM,KAAM,GAAM,CAAI,CAAC,GAAG;AACjD,WAAO;AAAA,EACX;AACA,MAAI,gBAAgB,MAAM,CAAC,GAAM,GAAM,KAAM,GAAI,CAAC,GAAG;AACjD,WAAO;AAAA,EACX;AACA,MAAI,gBAAgB,MAAM,CAAC,KAAM,KAAM,GAAI,CAAC,GAAG;AAC3C,WAAO;AAAA,EACX;AACA,MAAI,gBAAgB,MAAM,CAAC,KAAM,GAAI,CAAC,GAAG;AACrC,WAAO;AAAA,EACX;AACA,MAAI,gBAAgB,MAAM,CAAC,KAAM,GAAI,CAAC,GAAG;AACrC,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAQA,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ACzB,eAAO;AAAA,MACX;AACA,WAAK,MAAM;AACX,WAAK,OAAO,MAAM,YAAY,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,KAAK;AAC7D,aAAO;AAAA,IACX;AACA,QAAI,KAAK,GAAG;AACR,aAAO;AAAA,IACX;AACA,SAAK,MAAM;AACX,SAAK,OAAO,KAAK;AACjB,WAAO;AAAA,EACX;AACJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
|
|
2
|
-
import { u as uniqueColumnName,
|
|
3
|
-
import {
|
|
4
|
-
import { t as trimTrailingZeros } from "./text-
|
|
2
|
+
import { u as uniqueColumnName, j as declareResolved } from "./export-CZ7VRm4I.js";
|
|
3
|
+
import { L as BAD_ASPECT_BLOCK_CODE, $ as MULTI_ASPECT_FRAGMENT_CODE, a3 as ASPECT_ORDER_CODE, g as COUNT_MISMATCH_CODE, a5 as STATUS_FAILED_CODE, a4 as STATUS_WARNING_CODE, p as plural, a as agree, C as COLUMN_RENAMED_CODE, P as PRECISION_CODE, Z as JSON_NONSTANDARD_NUMBER_CODE, l as DUPLICATE_ATTRIBUTE_CODE, T as BAD_VALUE_CODE } from "./report-CgdsL9Hb.js";
|
|
4
|
+
import { t as trimTrailingZeros } from "./text-BuKQVMz2.js";
|
|
5
5
|
const MAYBE_UNSAFE_INTEGER = new RegExp("(?<![0-9.])\\d{16}");
|
|
6
6
|
const MAYBE_INEXACT_EXPONENT = new RegExp(
|
|
7
7
|
[
|
|
@@ -1311,4 +1311,4 @@ export {
|
|
|
1311
1311
|
scanAspects as s,
|
|
1312
1312
|
zDecl as z
|
|
1313
1313
|
};
|
|
1314
|
-
//# sourceMappingURL=json-elements-
|
|
1314
|
+
//# sourceMappingURL=json-elements-By172SVq.js.map
|