@loaders.gl/core 5.0.0-rc.2 → 5.0.1
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/api.cjs +4129 -0
- package/dist/api.cjs.map +6 -0
- package/dist/api.d.ts +34 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +50 -0
- package/dist/api.js.map +1 -0
- package/dist/arrow-geometry/geometry-codecs.cjs +51 -50
- package/dist/arrow-geometry/geometry-codecs.cjs.map +3 -3
- package/dist/arrow-geometry/geometry-codecs.d.ts +1 -1
- package/dist/arrow-geometry/geometry-codecs.d.ts.map +1 -1
- package/dist/arrow-geometry/geometry-codecs.js +27 -60
- package/dist/arrow-geometry/geometry-codecs.js.map +1 -1
- package/dist/arrow-geometry/index.cjs +5 -2
- package/dist/arrow-geometry/index.cjs.map +2 -2
- package/dist/arrow-geometry/index.d.ts +1 -0
- package/dist/arrow-geometry/index.d.ts.map +1 -1
- package/dist/arrow-geometry/index.js +1 -0
- package/dist/arrow-geometry/index.js.map +1 -1
- package/dist/arrow-geometry/triangulate-wkb-geometry-column.cjs +100 -0
- package/dist/arrow-geometry/triangulate-wkb-geometry-column.cjs.map +7 -0
- package/dist/arrow-geometry/triangulate-wkb-geometry-column.d.ts +15 -0
- package/dist/arrow-geometry/triangulate-wkb-geometry-column.d.ts.map +1 -0
- package/dist/arrow-geometry/triangulate-wkb-geometry-column.js +87 -0
- package/dist/arrow-geometry/triangulate-wkb-geometry-column.js.map +1 -0
- package/dist/arrow-geometry/triangulate-wkb.cjs +33 -118
- package/dist/arrow-geometry/triangulate-wkb.cjs.map +2 -2
- package/dist/arrow-geometry/triangulate-wkb.d.ts.map +1 -1
- package/dist/arrow-geometry/triangulate-wkb.js +39 -142
- package/dist/arrow-geometry/triangulate-wkb.js.map +1 -1
- package/dist/constants/index.cjs +2 -2
- package/dist/constants/index.d.ts +4 -4
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -2
- package/dist/constants/index.js.map +1 -1
- package/dist/dist.dev.js +460 -541
- package/dist/dist.min.js +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +15 -0
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +19 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs +6 -27
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.d.ts.map +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.js +9 -24
- package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
- package/dist/geoarrow/index.cjs +1 -1
- package/dist/geoarrow/index.cjs.map +1 -1
- package/dist/geoarrow/index.d.ts +2 -2
- package/dist/geoarrow/index.d.ts.map +1 -1
- package/dist/geoarrow/index.js +1 -1
- package/dist/geoarrow/index.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -5
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.d.ts +2 -24
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.d.ts.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +6 -28
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
- package/dist/geoarrow/lib/kernels/decode-wkt-native.cjs +21 -227
- package/dist/geoarrow/lib/kernels/decode-wkt-native.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/decode-wkt-native.d.ts +2 -3
- package/dist/geoarrow/lib/kernels/decode-wkt-native.d.ts.map +1 -1
- package/dist/geoarrow/lib/kernels/decode-wkt-native.js +24 -265
- package/dist/geoarrow/lib/kernels/decode-wkt-native.js.map +1 -1
- package/dist/index.cjs +67 -4114
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -46
- package/dist/index.js.map +1 -1
- package/dist/lib/api/encode-table.d.ts +4 -4
- package/dist/lib/api/encode-table.d.ts.map +1 -1
- package/dist/lib/api/encode-table.js +21 -3
- package/dist/lib/api/encode-table.js.map +1 -1
- package/dist/lib/api/encode.d.ts +6 -6
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +46 -7
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/loader-utils/index.cjs +96 -239
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +1 -1
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +1 -1
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader-metadata.cjs +85 -0
- package/dist/loader-utils/json-loader-metadata.cjs.map +6 -0
- package/dist/loader-utils/json-loader-metadata.d.ts +51 -0
- package/dist/loader-utils/json-loader-metadata.d.ts.map +1 -0
- package/dist/loader-utils/json-loader-metadata.js +31 -0
- package/dist/loader-utils/json-loader-metadata.js.map +1 -0
- package/dist/loader-utils/json-loader.cjs +80 -0
- package/dist/loader-utils/json-loader.cjs.map +6 -0
- package/dist/loader-utils/json-loader.d.ts +4 -4
- package/dist/loader-utils/json-loader.d.ts.map +1 -1
- package/dist/loader-utils/json-loader.js +3 -17
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +1 -1
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/request-utils/authentication.d.ts +2 -0
- package/dist/loader-utils/lib/request-utils/authentication.d.ts.map +1 -1
- package/dist/loader-utils/lib/request-utils/authentication.js +12 -0
- package/dist/loader-utils/lib/request-utils/authentication.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.d.ts +4 -52
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.js +16 -236
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/relational-query.d.ts +2 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/relational-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/raster-source.d.ts +4 -0
- package/dist/loader-utils/lib/sources/raster-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.d.ts +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.d.ts.map +1 -1
- package/dist/loader-utils/tile-grid.d.ts +2 -1
- package/dist/loader-utils/tile-grid.d.ts.map +1 -1
- package/dist/loader-utils/tile-grid.js +1 -1
- package/dist/loader-utils/tile-grid.js.map +1 -1
- package/dist/loader-utils/writer-types.d.ts +2 -0
- package/dist/loader-utils/writer-types.d.ts.map +1 -1
- package/dist/null-loader-metadata.cjs +89 -0
- package/dist/null-loader-metadata.cjs.map +6 -0
- package/dist/null-loader-metadata.d.ts +48 -0
- package/dist/null-loader-metadata.d.ts.map +1 -0
- package/dist/null-loader-metadata.js +30 -0
- package/dist/null-loader-metadata.js.map +1 -0
- package/dist/null-loader.cjs +84 -0
- package/dist/null-loader.cjs.map +6 -0
- package/dist/null-loader.d.ts +6 -6
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +2 -15
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +58 -28
- package/dist/null-worker.js +58 -28
- package/dist/scan/arrow-execution/expressions.cjs +9 -78
- package/dist/scan/arrow-execution/expressions.cjs.map +3 -3
- package/dist/scan/arrow-execution/expressions.d.ts +3 -9
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
- package/dist/scan/arrow-execution/expressions.js +2 -55
- package/dist/scan/arrow-execution/expressions.js.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +41 -179
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +3 -3
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts +1 -5
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js +44 -190
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
- package/dist/scan/arrow-execution.cjs +2 -2
- package/dist/scan/arrow-execution.cjs.map +2 -2
- package/dist/scan/arrow-execution.d.ts +1 -1
- package/dist/scan/arrow-execution.d.ts.map +1 -1
- package/dist/scan/arrow-execution.js +1 -1
- package/dist/scan/arrow-execution.js.map +1 -1
- package/dist/scan/arrow-query.cjs +3 -3
- package/dist/scan/arrow-query.cjs.map +2 -2
- package/dist/scan/arrow-query.d.ts +2 -2
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/arrow-query.js +2 -2
- package/dist/scan/arrow-query.js.map +1 -1
- package/dist/scan/federated-table-scan-source.cjs +3 -3
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.js +1 -1
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +25 -53
- package/dist/scan/index.cjs.map +3 -3
- package/dist/scan/index.d.ts +7 -4
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +6 -4
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/plan-arrow-table-query.cjs +271 -0
- package/dist/scan/plan-arrow-table-query.cjs.map +7 -0
- package/dist/scan/plan-arrow-table-query.d.ts +50 -0
- package/dist/scan/plan-arrow-table-query.d.ts.map +1 -0
- package/dist/scan/plan-arrow-table-query.js +257 -0
- package/dist/scan/plan-arrow-table-query.js.map +1 -0
- package/dist/scan/query-arrow-table-in-batches.cjs +7 -56
- package/dist/scan/query-arrow-table-in-batches.cjs.map +2 -2
- package/dist/scan/query-arrow-table-in-batches.d.ts +1 -1
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.js +7 -45
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -1
- package/dist/scan/query-arrow-table.cjs +7 -443
- package/dist/scan/query-arrow-table.cjs.map +3 -3
- package/dist/scan/query-arrow-table.d.ts +6 -54
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +6 -475
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-executor.cjs +202 -0
- package/dist/scan/query-executor.cjs.map +7 -0
- package/dist/scan/query-executor.d.ts +27 -0
- package/dist/scan/query-executor.d.ts.map +1 -0
- package/dist/scan/query-executor.js +203 -0
- package/dist/scan/query-executor.js.map +1 -0
- package/dist/scan/query-pushdown.cjs +3 -4
- package/dist/scan/query-pushdown.cjs.map +2 -2
- package/dist/scan/query-pushdown.js +4 -5
- package/dist/scan/query-pushdown.js.map +1 -1
- package/dist/scan/query.cjs +92 -204
- package/dist/scan/query.cjs.map +3 -3
- package/dist/scan/query.d.ts +5 -4
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +94 -229
- package/dist/scan/query.js.map +1 -1
- package/dist/scan/scan-engine.cjs +14 -7
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +1 -1
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js +4 -9
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +14 -3
- package/dist/scan/vector-table-scan-source.cjs.map +2 -2
- package/dist/scan/vector-table-scan-source.d.ts +1 -1
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +2 -1
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema-utils/index.cjs +193 -47
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +3 -0
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +3 -0
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-converter.d.ts +24 -0
- package/dist/schema-utils/lib/arrow/arrow-converter.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-converter.js +43 -0
- package/dist/schema-utils/lib/arrow/arrow-converter.js.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +2 -4
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +2 -43
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -1
- package/dist/schema-utils/lib/arrow/convert-arrow-variable-width.d.ts +29 -0
- package/dist/schema-utils/lib/arrow/convert-arrow-variable-width.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/convert-arrow-variable-width.js +89 -0
- package/dist/schema-utils/lib/arrow/convert-arrow-variable-width.js.map +1 -0
- package/dist/schema-utils/lib/arrow/convert-arrow.d.ts +17 -0
- package/dist/schema-utils/lib/arrow/convert-arrow.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/convert-arrow.js +24 -0
- package/dist/schema-utils/lib/arrow/convert-arrow.js.map +1 -0
- package/dist/schema-utils/lib/arrow/tighten-arrow-table-schema-nullability.d.ts +4 -0
- package/dist/schema-utils/lib/arrow/tighten-arrow-table-schema-nullability.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/tighten-arrow-table-schema-nullability.js +51 -0
- package/dist/schema-utils/lib/arrow/tighten-arrow-table-schema-nullability.js.map +1 -0
- package/dist/wkt/twkb/index.cjs +68 -5
- package/dist/wkt/twkb/index.cjs.map +3 -3
- package/dist/wkt/twkb/index.d.ts +10 -2
- package/dist/wkt/twkb/index.d.ts.map +1 -1
- package/dist/wkt/twkb/index.js +49 -2
- package/dist/wkt/twkb/index.js.map +1 -1
- package/dist/worker-utils/index.cjs +4 -4
- package/dist/worker-utils/index.cjs.map +1 -1
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/package.json +49 -23
- package/src/api.ts +99 -0
- package/src/arrow-geometry/geometry-codecs.ts +35 -78
- package/src/arrow-geometry/index.ts +5 -0
- package/src/arrow-geometry/triangulate-wkb-geometry-column.ts +122 -0
- package/src/arrow-geometry/triangulate-wkb.ts +37 -169
- package/src/constants/index.ts +2 -2
- package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +22 -1
- package/src/geoarrow/get-geoarrow-vertex-count.ts +7 -32
- package/src/geoarrow/index.ts +2 -2
- package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +6 -30
- package/src/geoarrow/lib/kernels/decode-wkt-native.ts +24 -270
- package/src/index.ts +2 -94
- package/src/lib/api/encode-table.ts +31 -6
- package/src/lib/api/encode.ts +61 -11
- package/src/loader-utils/index.ts +1 -0
- package/src/loader-utils/json-loader-metadata.ts +35 -0
- package/src/loader-utils/json-loader.ts +3 -18
- package/src/loader-utils/lib/request-utils/authentication.ts +17 -0
- package/src/loader-utils/lib/scan-utils/columnar-predicate.ts +46 -363
- package/src/loader-utils/lib/scan-utils/relational-query.ts +7 -1
- package/src/loader-utils/lib/sources/raster-source.ts +4 -0
- package/src/loader-utils/tile-grid.ts +16 -1
- package/src/loader-utils/writer-types.ts +2 -0
- package/src/null-loader-metadata.ts +32 -0
- package/src/null-loader.ts +2 -17
- package/src/scan/arrow-execution/expressions.ts +2 -86
- package/src/scan/arrow-execution/filter-arrow-table.ts +54 -238
- package/src/scan/arrow-execution.ts +1 -1
- package/src/scan/arrow-query.ts +2 -2
- package/src/scan/federated-table-scan-source.ts +1 -1
- package/src/scan/index.ts +24 -4
- package/src/scan/plan-arrow-table-query.ts +367 -0
- package/src/scan/query-arrow-table-in-batches.ts +8 -54
- package/src/scan/query-arrow-table.ts +10 -626
- package/src/scan/query-executor.ts +286 -0
- package/src/scan/query-pushdown.ts +3 -4
- package/src/scan/query.ts +112 -293
- package/src/scan/scan-engine.ts +4 -11
- package/src/scan/vector-table-scan-source.ts +2 -1
- package/src/schema-utils/index.ts +14 -0
- package/src/schema-utils/lib/arrow/arrow-converter.ts +74 -0
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +2 -50
- package/src/schema-utils/lib/arrow/convert-arrow-variable-width.ts +121 -0
- package/src/schema-utils/lib/arrow/convert-arrow.ts +52 -0
- package/src/schema-utils/lib/arrow/tighten-arrow-table-schema-nullability.ts +83 -0
- package/src/wkt/twkb/index.ts +63 -2
- package/dist/cluster-source.cjs +0 -6606
- package/dist/cluster-source.cjs.map +0 -6
- package/dist/cluster-source.d.ts +0 -2
- package/dist/cluster-source.d.ts.map +0 -1
- package/dist/cluster-source.js +0 -2
- package/dist/cluster-source.js.map +0 -1
- package/dist/federated-table-scan-source.cjs +0 -2303
- package/dist/federated-table-scan-source.cjs.map +0 -6
- package/dist/federated-table-scan-source.d.ts +0 -2
- package/dist/federated-table-scan-source.d.ts.map +0 -1
- package/dist/federated-table-scan-source.js +0 -2
- package/dist/federated-table-scan-source.js.map +0 -1
- package/dist/geoarrow/geoarrow-builder.cjs +0 -31
- package/dist/geoarrow/geoarrow-builder.cjs.map +0 -7
- package/dist/geoarrow/geoarrow-builder.d.ts +0 -3
- package/dist/geoarrow/geoarrow-builder.d.ts.map +0 -1
- package/dist/geoarrow/geoarrow-builder.js +0 -5
- package/dist/geoarrow/geoarrow-builder.js.map +0 -1
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs +0 -41
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs.map +0 -7
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts +0 -5
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts.map +0 -1
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js +0 -23
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js.map +0 -1
- package/dist/scan/arrow-execution/project-arrow-table.cjs +0 -70
- package/dist/scan/arrow-execution/project-arrow-table.cjs.map +0 -7
- package/dist/scan/arrow-execution/project-arrow-table.d.ts +0 -8
- package/dist/scan/arrow-execution/project-arrow-table.d.ts.map +0 -1
- package/dist/scan/arrow-execution/project-arrow-table.js +0 -39
- package/dist/scan/arrow-execution/project-arrow-table.js.map +0 -1
- package/dist/scan/query-arrow-table-math.cjs +0 -41
- package/dist/scan/query-arrow-table-math.cjs.map +0 -7
- package/dist/scan/query-arrow-table-math.d.ts +0 -5
- package/dist/scan/query-arrow-table-math.d.ts.map +0 -1
- package/dist/scan/query-arrow-table-math.js +0 -14
- package/dist/scan/query-arrow-table-math.js.map +0 -1
- package/dist/vector-table-scan-source.cjs +0 -1660
- package/dist/vector-table-scan-source.cjs.map +0 -6
- package/dist/vector-table-scan-source.d.ts +0 -2
- package/dist/vector-table-scan-source.d.ts.map +0 -1
- package/dist/vector-table-scan-source.js +0 -2
- package/dist/vector-table-scan-source.js.map +0 -1
- package/dist/wkt/twkb/convert-geometry-to-twkb.cjs +0 -211
- package/dist/wkt/twkb/convert-geometry-to-twkb.cjs.map +0 -7
- package/dist/wkt/twkb/convert-geometry-to-twkb.d.ts +0 -6
- package/dist/wkt/twkb/convert-geometry-to-twkb.d.ts.map +0 -1
- package/dist/wkt/twkb/convert-geometry-to-twkb.js +0 -204
- package/dist/wkt/twkb/convert-geometry-to-twkb.js.map +0 -1
- package/dist/wkt/twkb/convert-twkb-to-geometry.cjs +0 -251
- package/dist/wkt/twkb/convert-twkb-to-geometry.cjs.map +0 -7
- package/dist/wkt/twkb/convert-twkb-to-geometry.d.ts +0 -10
- package/dist/wkt/twkb/convert-twkb-to-geometry.d.ts.map +0 -1
- package/dist/wkt/twkb/convert-twkb-to-geometry.js +0 -261
- package/dist/wkt/twkb/convert-twkb-to-geometry.js.map +0 -1
- package/dist/wkt/twkb/twkb-io.cjs +0 -102
- package/dist/wkt/twkb/twkb-io.cjs.map +0 -7
- package/dist/wkt/twkb/twkb-io.d.ts +0 -33
- package/dist/wkt/twkb/twkb-io.d.ts.map +0 -1
- package/dist/wkt/twkb/twkb-io.js +0 -78
- package/dist/wkt/twkb/twkb-io.js.map +0 -1
- package/dist/wkt/twkb/twkb-types.cjs +0 -40
- package/dist/wkt/twkb/twkb-types.cjs.map +0 -7
- package/dist/wkt/twkb/twkb-types.d.ts +0 -11
- package/dist/wkt/twkb/twkb-types.d.ts.map +0 -1
- package/dist/wkt/twkb/twkb-types.js +0 -15
- package/dist/wkt/twkb/twkb-types.js.map +0 -1
- package/src/cluster-source.ts +0 -1
- package/src/federated-table-scan-source.ts +0 -1
- package/src/geoarrow/geoarrow-builder.ts +0 -21
- package/src/scan/arrow-execution/portable-predicate-compatibility.ts +0 -27
- package/src/scan/arrow-execution/project-arrow-table.ts +0 -53
- package/src/scan/query-arrow-table-math.ts +0 -23
- package/src/vector-table-scan-source.ts +0 -1
- package/src/wkt/twkb/convert-geometry-to-twkb.ts +0 -317
- package/src/wkt/twkb/convert-twkb-to-geometry.ts +0 -373
- package/src/wkt/twkb/twkb-io.ts +0 -85
- package/src/wkt/twkb/twkb-types.ts +0 -14
package/dist/dist.dev.js
CHANGED
|
@@ -10,6 +10,14 @@ var __exports__ = (() => {
|
|
|
10
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __esm = (fn, res, err) => function __init() {
|
|
14
|
+
if (err) throw err[0];
|
|
15
|
+
try {
|
|
16
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw err = [e], e;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
13
21
|
var __export = (target, all) => {
|
|
14
22
|
for (var name in all)
|
|
15
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -24,12 +32,120 @@ var __exports__ = (() => {
|
|
|
24
32
|
};
|
|
25
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
34
|
|
|
35
|
+
// dist/loader-utils/json-loader-metadata.js
|
|
36
|
+
var VERSION5, JSONLoaderMetadata, JSONLoader;
|
|
37
|
+
var init_json_loader_metadata = __esm({
|
|
38
|
+
"dist/loader-utils/json-loader-metadata.js"() {
|
|
39
|
+
"use strict";
|
|
40
|
+
VERSION5 = true ? "5.0.1" : "latest";
|
|
41
|
+
JSONLoaderMetadata = {
|
|
42
|
+
dataType: null,
|
|
43
|
+
batchType: null,
|
|
44
|
+
name: "JSON",
|
|
45
|
+
id: "json",
|
|
46
|
+
module: "json",
|
|
47
|
+
version: VERSION5,
|
|
48
|
+
encoding: "json",
|
|
49
|
+
format: "json",
|
|
50
|
+
extensions: ["json", "geojson"],
|
|
51
|
+
mimeTypes: ["application/json"],
|
|
52
|
+
category: "json",
|
|
53
|
+
text: true,
|
|
54
|
+
options: {}
|
|
55
|
+
};
|
|
56
|
+
JSONLoader = {
|
|
57
|
+
...JSONLoaderMetadata,
|
|
58
|
+
async preload() {
|
|
59
|
+
const implementation = await Promise.resolve().then(() => (init_json_loader(), json_loader_exports));
|
|
60
|
+
return implementation.JSONLoader;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// dist/loader-utils/json-loader.js
|
|
67
|
+
var json_loader_exports = {};
|
|
68
|
+
__export(json_loader_exports, {
|
|
69
|
+
JSONLoader: () => JSONLoader2
|
|
70
|
+
});
|
|
71
|
+
function parseTextSync(text) {
|
|
72
|
+
return JSON.parse(text);
|
|
73
|
+
}
|
|
74
|
+
var JSONLoader2;
|
|
75
|
+
var init_json_loader = __esm({
|
|
76
|
+
"dist/loader-utils/json-loader.js"() {
|
|
77
|
+
"use strict";
|
|
78
|
+
init_json_loader_metadata();
|
|
79
|
+
JSONLoader2 = {
|
|
80
|
+
...JSONLoaderMetadata,
|
|
81
|
+
parseTextSync,
|
|
82
|
+
parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer))
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// src/null-loader-metadata.ts
|
|
88
|
+
var VERSION6, NullLoaderMetadata, NullLoader;
|
|
89
|
+
var init_null_loader_metadata = __esm({
|
|
90
|
+
"src/null-loader-metadata.ts"() {
|
|
91
|
+
"use strict";
|
|
92
|
+
VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
93
|
+
NullLoaderMetadata = {
|
|
94
|
+
dataType: null,
|
|
95
|
+
batchType: null,
|
|
96
|
+
name: "Null loader",
|
|
97
|
+
id: "null",
|
|
98
|
+
module: "core",
|
|
99
|
+
version: VERSION6,
|
|
100
|
+
mimeTypes: ["application/x.empty"],
|
|
101
|
+
extensions: ["null"],
|
|
102
|
+
tests: [() => false],
|
|
103
|
+
options: {
|
|
104
|
+
null: {}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
NullLoader = {
|
|
108
|
+
...NullLoaderMetadata,
|
|
109
|
+
async preload() {
|
|
110
|
+
const implementation = await Promise.resolve().then(() => (init_null_loader(), null_loader_exports));
|
|
111
|
+
return implementation.NullLoader;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// src/null-loader.ts
|
|
118
|
+
var null_loader_exports = {};
|
|
119
|
+
__export(null_loader_exports, {
|
|
120
|
+
NullLoader: () => NullLoader2
|
|
121
|
+
});
|
|
122
|
+
function parseSync2(arrayBuffer, options, context) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
var NullLoader2;
|
|
126
|
+
var init_null_loader = __esm({
|
|
127
|
+
"src/null-loader.ts"() {
|
|
128
|
+
"use strict";
|
|
129
|
+
init_null_loader_metadata();
|
|
130
|
+
NullLoader2 = {
|
|
131
|
+
...NullLoaderMetadata,
|
|
132
|
+
parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options || {}, context),
|
|
133
|
+
parseSync: parseSync2,
|
|
134
|
+
parseInBatches: async function* generator(asyncIterator, options, context) {
|
|
135
|
+
for await (const batch of asyncIterator) {
|
|
136
|
+
yield parseSync2(batch, options, context);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
27
143
|
// bundle.ts
|
|
28
144
|
var bundle_exports = {};
|
|
29
145
|
__export(bundle_exports, {
|
|
30
146
|
FetchError: () => FetchError,
|
|
31
|
-
JSONLoader: () =>
|
|
32
|
-
NullLoader: () =>
|
|
147
|
+
JSONLoader: () => JSONLoader2,
|
|
148
|
+
NullLoader: () => NullLoader2,
|
|
33
149
|
RequestScheduler: () => RequestScheduler,
|
|
34
150
|
_BrowserFileSystem: () => BrowserFileSystem,
|
|
35
151
|
_fetchProgress: () => fetchProgress,
|
|
@@ -91,14 +207,14 @@ var __exports__ = (() => {
|
|
|
91
207
|
window: () => window_
|
|
92
208
|
});
|
|
93
209
|
|
|
94
|
-
//
|
|
210
|
+
// dist/loader-utils/lib/env-utils/assert.js
|
|
95
211
|
function assert(condition, message) {
|
|
96
212
|
if (!condition) {
|
|
97
213
|
throw new Error(message || "loader assertion failed.");
|
|
98
214
|
}
|
|
99
215
|
}
|
|
100
216
|
|
|
101
|
-
//
|
|
217
|
+
// dist/loader-utils/lib/env-utils/globals.js
|
|
102
218
|
var globals = {
|
|
103
219
|
self: typeof self !== "undefined" && self,
|
|
104
220
|
window: typeof window !== "undefined" && window,
|
|
@@ -662,8 +778,8 @@ var __exports__ = (() => {
|
|
|
662
778
|
// ../../node_modules/probe.gl/dist/log/index.js
|
|
663
779
|
var log = new ProbeLog({ id: "@probe.gl/log" });
|
|
664
780
|
|
|
665
|
-
//
|
|
666
|
-
var VERSION2 =
|
|
781
|
+
// dist/loader-utils/lib/log-utils/log.js
|
|
782
|
+
var VERSION2 = true ? "5.0.1" : "latest";
|
|
667
783
|
var version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
668
784
|
function createLog() {
|
|
669
785
|
const log3 = new ProbeLog({ id: "loaders.gl" });
|
|
@@ -705,7 +821,7 @@ var __exports__ = (() => {
|
|
|
705
821
|
return logger === null ? nullLog : logger || log2;
|
|
706
822
|
}
|
|
707
823
|
|
|
708
|
-
//
|
|
824
|
+
// dist/loader-utils/lib/javascript-utils/is-type.js
|
|
709
825
|
var isBoolean = (value) => typeof value === "boolean";
|
|
710
826
|
var isFunction = (value) => typeof value === "function";
|
|
711
827
|
var isObject = (value) => value !== null && typeof value === "object";
|
|
@@ -725,7 +841,7 @@ var __exports__ = (() => {
|
|
|
725
841
|
var isReadableStream = (value) => isReadableDOMStream(value) || isReadableNodeStream(value);
|
|
726
842
|
var isWritableStream = (value) => isWritableDOMStream(value) || isWritableNodeStream(value);
|
|
727
843
|
|
|
728
|
-
//
|
|
844
|
+
// dist/loader-utils/lib/option-utils/merge-options.js
|
|
729
845
|
function mergeOptions(baseOptions, newOptions) {
|
|
730
846
|
return mergeOptionsRecursively(baseOptions || {}, newOptions);
|
|
731
847
|
}
|
|
@@ -736,11 +852,7 @@ var __exports__ = (() => {
|
|
|
736
852
|
const options = { ...baseOptions };
|
|
737
853
|
for (const [key, newValue] of Object.entries(newOptions)) {
|
|
738
854
|
if (isPureObject(newValue)) {
|
|
739
|
-
options[key] = mergeOptionsRecursively(
|
|
740
|
-
options[key] || {},
|
|
741
|
-
newOptions[key],
|
|
742
|
-
level + 1
|
|
743
|
-
);
|
|
855
|
+
options[key] = mergeOptionsRecursively(options[key] || {}, newOptions[key], level + 1);
|
|
744
856
|
} else {
|
|
745
857
|
options[key] = newOptions[key];
|
|
746
858
|
}
|
|
@@ -748,36 +860,36 @@ var __exports__ = (() => {
|
|
|
748
860
|
return options;
|
|
749
861
|
}
|
|
750
862
|
|
|
751
|
-
//
|
|
863
|
+
// dist/loader-utils/lib/module-utils/js-module-utils.js
|
|
752
864
|
function registerJSModules(modules) {
|
|
753
865
|
globalThis.loaders ||= {};
|
|
754
866
|
globalThis.loaders.modules ||= {};
|
|
755
867
|
Object.assign(globalThis.loaders.modules, modules);
|
|
756
868
|
}
|
|
757
869
|
|
|
758
|
-
//
|
|
759
|
-
var LOADERS_GL_FIXTURE_BRANCH = "
|
|
870
|
+
// dist/constants/index.js
|
|
871
|
+
var LOADERS_GL_FIXTURE_BRANCH = "5.0-release";
|
|
760
872
|
var LOADERS_GL_RAW_FIXTURE_URL = `https://raw.githubusercontent.com/visgl/loaders.gl/${LOADERS_GL_FIXTURE_BRANCH}/`;
|
|
761
873
|
var LOADERS_GL_REDIRECTING_FIXTURE_URL = `https://github.com/visgl/loaders.gl/raw/${LOADERS_GL_FIXTURE_BRANCH}/`;
|
|
762
|
-
var NPM_TAG = "
|
|
874
|
+
var NPM_TAG = "latest";
|
|
763
875
|
|
|
764
|
-
//
|
|
876
|
+
// dist/worker-utils/lib/env-utils/version.js
|
|
765
877
|
function getVersion() {
|
|
766
|
-
const version2 =
|
|
878
|
+
const version2 = false ? NPM_TAG : "5.0.1";
|
|
767
879
|
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
768
880
|
globalThis._loadersgl_.version ||= version2;
|
|
769
881
|
return version2;
|
|
770
882
|
}
|
|
771
883
|
var VERSION3 = getVersion();
|
|
772
884
|
|
|
773
|
-
//
|
|
885
|
+
// dist/worker-utils/lib/env-utils/assert.js
|
|
774
886
|
function assert4(condition, message) {
|
|
775
887
|
if (!condition) {
|
|
776
888
|
throw new Error(message || "loaders.gl assertion failed.");
|
|
777
889
|
}
|
|
778
890
|
}
|
|
779
891
|
|
|
780
|
-
//
|
|
892
|
+
// dist/worker-utils/lib/env-utils/globals.js
|
|
781
893
|
var globals2 = {
|
|
782
894
|
self: typeof self !== "undefined" && self,
|
|
783
895
|
window: typeof window !== "undefined" && window,
|
|
@@ -3693,7 +3805,7 @@ var __exports__ = (() => {
|
|
|
3693
3805
|
}
|
|
3694
3806
|
}
|
|
3695
3807
|
|
|
3696
|
-
//
|
|
3808
|
+
// dist/worker-utils/lib/worker-api/get-worker-url.js
|
|
3697
3809
|
var warnedWorkerVersionFallbacks2 = /* @__PURE__ */ new Set();
|
|
3698
3810
|
function getCustomWorkerURL2(worker, options = {}) {
|
|
3699
3811
|
const workerFile = isBrowser3 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
|
|
@@ -3743,17 +3855,15 @@ var __exports__ = (() => {
|
|
|
3743
3855
|
return;
|
|
3744
3856
|
}
|
|
3745
3857
|
warnedWorkerVersionFallbacks2.add(workerId);
|
|
3746
|
-
log2.warn(
|
|
3747
|
-
`loaders.gl: ${worker.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${url} from CDN.`
|
|
3748
|
-
)();
|
|
3858
|
+
log2.warn(`loaders.gl: ${worker.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${url} from CDN.`)();
|
|
3749
3859
|
}
|
|
3750
3860
|
|
|
3751
|
-
//
|
|
3861
|
+
// dist/worker-utils/lib/worker-api/task-runtime.js
|
|
3752
3862
|
function normalizeTaskProgress(progress) {
|
|
3753
3863
|
return { ...progress, phase: progress.phase ?? "process", unit: progress.unit ?? "items" };
|
|
3754
3864
|
}
|
|
3755
3865
|
|
|
3756
|
-
//
|
|
3866
|
+
// dist/worker-utils/lib/worker-utils/get-transfer-list.js
|
|
3757
3867
|
function getTransferList2(object, recursive = true, transfers) {
|
|
3758
3868
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
3759
3869
|
if (!object) {
|
|
@@ -3804,19 +3914,19 @@ var __exports__ = (() => {
|
|
|
3804
3914
|
return clone;
|
|
3805
3915
|
}
|
|
3806
3916
|
|
|
3807
|
-
//
|
|
3917
|
+
// dist/worker-utils/lib/worker-api/process-on-worker.js
|
|
3808
3918
|
var runners = /* @__PURE__ */ new WeakMap();
|
|
3809
3919
|
var activeRunners = /* @__PURE__ */ new Set();
|
|
3810
3920
|
var moduleWorkerUrls = /* @__PURE__ */ new Map();
|
|
3811
3921
|
function canProcessOnWorker2(worker, options = {}) {
|
|
3812
3922
|
const supported = isBrowser3 ? typeof Worker !== "undefined" : Boolean(options._nodeWorkers);
|
|
3813
|
-
return Boolean(
|
|
3814
|
-
supported && options.worker && (worker.worker || worker.loadWorker || getConfiguredWorkerURL2(worker, options))
|
|
3815
|
-
);
|
|
3923
|
+
return Boolean(supported && options.worker && (worker.worker || worker.loadWorker || getConfiguredWorkerURL2(worker, options)));
|
|
3816
3924
|
}
|
|
3817
3925
|
function canProcessOnWorkerInBatches2(worker, options = {}) {
|
|
3818
|
-
if (!canProcessOnWorker2(worker, options))
|
|
3819
|
-
|
|
3926
|
+
if (!canProcessOnWorker2(worker, options))
|
|
3927
|
+
return false;
|
|
3928
|
+
if (options.workerInBatches !== void 0)
|
|
3929
|
+
return options.workerInBatches;
|
|
3820
3930
|
return Boolean(worker.workerInBatches && !getConfiguredWorkerURL2(worker, options));
|
|
3821
3931
|
}
|
|
3822
3932
|
async function processOnWorker2(worker, data, options = {}, context = {}, jobContext = {}) {
|
|
@@ -3828,13 +3938,10 @@ var __exports__ = (() => {
|
|
|
3828
3938
|
try {
|
|
3829
3939
|
const input = data instanceof Promise ? await waitForInput(data, signal) : data;
|
|
3830
3940
|
const session = await sessionPromise;
|
|
3831
|
-
const result = await session.handle.runTask(
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
options: getParserOptions(options)
|
|
3836
|
-
}
|
|
3837
|
-
);
|
|
3941
|
+
const result = await session.handle.runTask({ value: input }, {
|
|
3942
|
+
...getControls(options),
|
|
3943
|
+
options: getParserOptions(options)
|
|
3944
|
+
});
|
|
3838
3945
|
return result.value;
|
|
3839
3946
|
} catch (error) {
|
|
3840
3947
|
controller.abort(error);
|
|
@@ -3878,9 +3985,7 @@ var __exports__ = (() => {
|
|
|
3878
3985
|
}
|
|
3879
3986
|
function getTask(worker, options) {
|
|
3880
3987
|
if (options.source || options.core?.source)
|
|
3881
|
-
throw new Error(
|
|
3882
|
-
"Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory"
|
|
3883
|
-
);
|
|
3988
|
+
throw new Error("Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory");
|
|
3884
3989
|
const create = !getCustomWorkerURL2(worker, options) && isBrowser3 ? worker.loadWorker : void 0;
|
|
3885
3990
|
return {
|
|
3886
3991
|
id: `${worker.module}:${worker.id}`,
|
|
@@ -3933,19 +4038,15 @@ var __exports__ = (() => {
|
|
|
3933
4038
|
if (channel) {
|
|
3934
4039
|
channel.port1.onmessage = async ({ data }) => {
|
|
3935
4040
|
try {
|
|
3936
|
-
const value = await context.process(
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
signal: callbackController.signal,
|
|
3941
|
-
throwIfAborted: () => callbackController.signal.throwIfAborted()
|
|
3942
|
-
},
|
|
3943
|
-
data.context
|
|
3944
|
-
);
|
|
4041
|
+
const value = await context.process(data.input, data.options, {
|
|
4042
|
+
signal: callbackController.signal,
|
|
4043
|
+
throwIfAborted: () => callbackController.signal.throwIfAborted()
|
|
4044
|
+
}, data.context);
|
|
3945
4045
|
if (!channelClosed && !callbackController.signal.aborted)
|
|
3946
4046
|
channel.port1.postMessage({ identifier: data.identifier, value }, getTransferList2(value));
|
|
3947
4047
|
} catch (error) {
|
|
3948
|
-
if (channelClosed || callbackController.signal.aborted)
|
|
4048
|
+
if (channelClosed || callbackController.signal.aborted)
|
|
4049
|
+
return;
|
|
3949
4050
|
channel.port1.postMessage({
|
|
3950
4051
|
identifier: data.identifier,
|
|
3951
4052
|
error: {
|
|
@@ -3961,10 +4062,12 @@ var __exports__ = (() => {
|
|
|
3961
4062
|
activeRunners.add(runnerState);
|
|
3962
4063
|
let released = false;
|
|
3963
4064
|
const releaseRunner = () => {
|
|
3964
|
-
if (released)
|
|
4065
|
+
if (released)
|
|
4066
|
+
return;
|
|
3965
4067
|
released = true;
|
|
3966
4068
|
runnerState.requests--;
|
|
3967
|
-
if (!runnerState.requests)
|
|
4069
|
+
if (!runnerState.requests)
|
|
4070
|
+
activeRunners.delete(runnerState);
|
|
3968
4071
|
};
|
|
3969
4072
|
let handle;
|
|
3970
4073
|
try {
|
|
@@ -4003,7 +4106,8 @@ var __exports__ = (() => {
|
|
|
4003
4106
|
return this;
|
|
4004
4107
|
},
|
|
4005
4108
|
async next() {
|
|
4006
|
-
if (inputClosed)
|
|
4109
|
+
if (inputClosed)
|
|
4110
|
+
return { done: true, value: void 0 };
|
|
4007
4111
|
const next = await iterator.next();
|
|
4008
4112
|
if (next.done || inputClosed) {
|
|
4009
4113
|
inputClosed = true;
|
|
@@ -4026,9 +4130,7 @@ var __exports__ = (() => {
|
|
|
4026
4130
|
if (/^https?:$/.test(resolved.protocol) && resolved.origin !== globalThis.location.origin) {
|
|
4027
4131
|
let shimUrl = moduleWorkerUrls.get(resolved.href);
|
|
4028
4132
|
if (!shimUrl) {
|
|
4029
|
-
shimUrl = URL.createObjectURL(
|
|
4030
|
-
new Blob([`import ${JSON.stringify(resolved.href)};`], { type: "application/javascript" })
|
|
4031
|
-
);
|
|
4133
|
+
shimUrl = URL.createObjectURL(new Blob([`import ${JSON.stringify(resolved.href)};`], { type: "application/javascript" }));
|
|
4032
4134
|
moduleWorkerUrls.set(resolved.href, shimUrl);
|
|
4033
4135
|
}
|
|
4034
4136
|
workerUrl = shimUrl;
|
|
@@ -4036,7 +4138,7 @@ var __exports__ = (() => {
|
|
|
4036
4138
|
return new Worker(workerUrl, { type: "module" });
|
|
4037
4139
|
}
|
|
4038
4140
|
|
|
4039
|
-
//
|
|
4141
|
+
// dist/worker-utils/lib/worker-api/validate-worker-version.js
|
|
4040
4142
|
function validateWorkerVersion(worker, coreVersion = VERSION3) {
|
|
4041
4143
|
assert4(worker, "no worker provided");
|
|
4042
4144
|
const workerVersion = worker.version;
|
|
@@ -4046,16 +4148,15 @@ var __exports__ = (() => {
|
|
|
4046
4148
|
return true;
|
|
4047
4149
|
}
|
|
4048
4150
|
|
|
4049
|
-
//
|
|
4151
|
+
// dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js
|
|
4050
4152
|
function canParseWithWorker(loader, options) {
|
|
4051
4153
|
const workerUrl = options?.[loader.id]?.workerUrl;
|
|
4052
4154
|
if (options?.core?.worker === false || !(loader.worker || loader.loadWorker || workerUrl))
|
|
4053
4155
|
return false;
|
|
4054
|
-
if (options?.core?.credentials?.some(
|
|
4055
|
-
|
|
4056
|
-
)
|
|
4156
|
+
if (options?.core?.credentials?.some((credential) => credential.type === "request" || "token" in credential && typeof credential.token === "function"))
|
|
4157
|
+
return false;
|
|
4158
|
+
if (loader.id === "shapefile" && typeof options?.core?.fetch === "function")
|
|
4057
4159
|
return false;
|
|
4058
|
-
if (loader.id === "shapefile" && typeof options?.core?.fetch === "function") return false;
|
|
4059
4160
|
const workerOptions = getWorkerOptions(options);
|
|
4060
4161
|
const nodeWorkers = workerOptions._nodeWorkers;
|
|
4061
4162
|
if (!isBrowser3 && !nodeWorkers) {
|
|
@@ -4071,9 +4172,7 @@ var __exports__ = (() => {
|
|
|
4071
4172
|
if (loader.id === "parquet" && typeof parquetOptions?.keyRetriever === "function") {
|
|
4072
4173
|
return false;
|
|
4073
4174
|
}
|
|
4074
|
-
return Boolean(
|
|
4075
|
-
loader.workerInBatches && canParseWithWorker(loader, options) && canProcessOnWorkerInBatches2(loader, getWorkerOptions(options))
|
|
4076
|
-
);
|
|
4175
|
+
return Boolean(loader.workerInBatches && canParseWithWorker(loader, options) && canProcessOnWorkerInBatches2(loader, getWorkerOptions(options)));
|
|
4077
4176
|
}
|
|
4078
4177
|
function shouldParseWithWorker(loader, data, options, context, estimateLoader = loader) {
|
|
4079
4178
|
if (!canParseWithWorker(loader, options)) {
|
|
@@ -4094,76 +4193,53 @@ var __exports__ = (() => {
|
|
|
4094
4193
|
}
|
|
4095
4194
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread, signal) {
|
|
4096
4195
|
const workerSignal = signal || getWorkerAbortSignal(options) || context?.signal;
|
|
4097
|
-
const result = await processOnWorker2(
|
|
4098
|
-
loader,
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
{
|
|
4106
|
-
process: async (input, processOptions, workerContext, parseContext) => {
|
|
4107
|
-
if (!parseOnMainThread) {
|
|
4108
|
-
throw new Error("Worker not set up to parse on main thread");
|
|
4109
|
-
}
|
|
4110
|
-
const { _loaderIds, _loaderIsArray, ...workerParseContext } = parseContext || {};
|
|
4111
|
-
const mainThreadContext = context || parseContext || workerContext?.signal ? {
|
|
4112
|
-
...context,
|
|
4113
|
-
...workerParseContext,
|
|
4114
|
-
signal: workerContext?.signal ?? context?.signal
|
|
4115
|
-
} : void 0;
|
|
4116
|
-
return await callParseOnMainThread(
|
|
4117
|
-
parseOnMainThread,
|
|
4118
|
-
input,
|
|
4119
|
-
processOptions,
|
|
4120
|
-
mainThreadContext,
|
|
4121
|
-
resolveWorkerLoaders(loader, _loaderIds, _loaderIsArray, context, options)
|
|
4122
|
-
);
|
|
4196
|
+
const result = await processOnWorker2(loader, data, {
|
|
4197
|
+
...getWorkerOptions(options, loader),
|
|
4198
|
+
signal: workerSignal,
|
|
4199
|
+
onProgress: options?.onProgress || context?.reportProgress
|
|
4200
|
+
}, {
|
|
4201
|
+
process: async (input, processOptions, workerContext, parseContext) => {
|
|
4202
|
+
if (!parseOnMainThread) {
|
|
4203
|
+
throw new Error("Worker not set up to parse on main thread");
|
|
4123
4204
|
}
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4205
|
+
const { _loaderIds, _loaderIsArray, ...workerParseContext } = parseContext || {};
|
|
4206
|
+
const mainThreadContext = context || parseContext || workerContext?.signal ? {
|
|
4207
|
+
...context,
|
|
4208
|
+
...workerParseContext,
|
|
4209
|
+
signal: workerContext?.signal ?? context?.signal
|
|
4210
|
+
} : void 0;
|
|
4211
|
+
return await callParseOnMainThread(parseOnMainThread, input, processOptions, mainThreadContext, resolveWorkerLoaders(loader, _loaderIds, _loaderIsArray, context, options));
|
|
4212
|
+
}
|
|
4213
|
+
}, getSerializableLoaderContext(context));
|
|
4127
4214
|
return isLoaderWithWorkerResultDeserializer(loader) ? loader.deserializeWorkerResult(result, options, context) : result;
|
|
4128
4215
|
}
|
|
4129
4216
|
async function* parseWithWorkerInBatches(loader, inputIterator, options, context, parseOnMainThread, signal) {
|
|
4130
4217
|
const workerSignal = signal || getWorkerAbortSignal(options) || context?.signal;
|
|
4131
|
-
const outputIterator = processOnWorkerInBatches2(
|
|
4132
|
-
loader,
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
{
|
|
4140
|
-
process: async (input, processOptions, workerContext, parseContext) => {
|
|
4141
|
-
if (!parseOnMainThread) {
|
|
4142
|
-
throw new Error("Worker not set up to parse on main thread");
|
|
4143
|
-
}
|
|
4144
|
-
const { _loaderIds, _loaderIsArray, ...workerParseContext } = parseContext || {};
|
|
4145
|
-
const mainThreadContext = context || parseContext || workerContext?.signal ? {
|
|
4146
|
-
...context,
|
|
4147
|
-
...workerParseContext,
|
|
4148
|
-
signal: workerContext?.signal ?? context?.signal
|
|
4149
|
-
} : void 0;
|
|
4150
|
-
return await callParseOnMainThread(
|
|
4151
|
-
parseOnMainThread,
|
|
4152
|
-
input,
|
|
4153
|
-
processOptions,
|
|
4154
|
-
mainThreadContext,
|
|
4155
|
-
resolveWorkerLoaders(loader, _loaderIds, _loaderIsArray, context, options)
|
|
4156
|
-
);
|
|
4218
|
+
const outputIterator = processOnWorkerInBatches2(loader, inputIterator, {
|
|
4219
|
+
...getWorkerOptions(options, loader),
|
|
4220
|
+
signal: workerSignal,
|
|
4221
|
+
onProgress: options?.onProgress || context?.reportProgress
|
|
4222
|
+
}, {
|
|
4223
|
+
process: async (input, processOptions, workerContext, parseContext) => {
|
|
4224
|
+
if (!parseOnMainThread) {
|
|
4225
|
+
throw new Error("Worker not set up to parse on main thread");
|
|
4157
4226
|
}
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4227
|
+
const { _loaderIds, _loaderIsArray, ...workerParseContext } = parseContext || {};
|
|
4228
|
+
const mainThreadContext = context || parseContext || workerContext?.signal ? {
|
|
4229
|
+
...context,
|
|
4230
|
+
...workerParseContext,
|
|
4231
|
+
signal: workerContext?.signal ?? context?.signal
|
|
4232
|
+
} : void 0;
|
|
4233
|
+
return await callParseOnMainThread(parseOnMainThread, input, processOptions, mainThreadContext, resolveWorkerLoaders(loader, _loaderIds, _loaderIsArray, context, options));
|
|
4234
|
+
}
|
|
4235
|
+
}, getSerializableLoaderContext(context));
|
|
4161
4236
|
for await (const batch of outputIterator) {
|
|
4162
4237
|
yield loader.deserializeWorkerBatch ? loader.deserializeWorkerBatch(batch, options, context) : batch;
|
|
4163
4238
|
}
|
|
4164
4239
|
}
|
|
4165
4240
|
function getWorkerAbortSignal(options) {
|
|
4166
|
-
if (options?.signal)
|
|
4241
|
+
if (options?.signal)
|
|
4242
|
+
return options.signal;
|
|
4167
4243
|
const parquetSignal = options?.parquet?.signal;
|
|
4168
4244
|
if (typeof AbortSignal !== "undefined" && parquetSignal instanceof AbortSignal) {
|
|
4169
4245
|
return parquetSignal;
|
|
@@ -4177,7 +4253,8 @@ var __exports__ = (() => {
|
|
|
4177
4253
|
return parseOnMainThread(input, loaders, options, context);
|
|
4178
4254
|
}
|
|
4179
4255
|
function resolveWorkerLoaders(loader, loaderIds, loaderIsArray, context, options) {
|
|
4180
|
-
if (!loaderIds)
|
|
4256
|
+
if (!loaderIds)
|
|
4257
|
+
return void 0;
|
|
4181
4258
|
const availableLoaders = /* @__PURE__ */ new Map();
|
|
4182
4259
|
const visitedLoaders = /* @__PURE__ */ new Set();
|
|
4183
4260
|
for (const candidate of [loader, ...context?.loaders || []]) {
|
|
@@ -4186,15 +4263,14 @@ var __exports__ = (() => {
|
|
|
4186
4263
|
const selectedLoaders = loaderIds.map((loaderId) => {
|
|
4187
4264
|
const selectedLoader = availableLoaders.get(loaderId);
|
|
4188
4265
|
if (!selectedLoader) {
|
|
4189
|
-
throw new Error(
|
|
4190
|
-
`Worker requested unknown loader "${loaderId}". Declare it in loader.subloaders or pass it in context.loaders.`
|
|
4191
|
-
);
|
|
4266
|
+
throw new Error(`Worker requested unknown loader "${loaderId}". Declare it in loader.subloaders or pass it in context.loaders.`);
|
|
4192
4267
|
}
|
|
4193
4268
|
return selectedLoader;
|
|
4194
4269
|
});
|
|
4195
4270
|
return loaderIsArray ? selectedLoaders : selectedLoaders[0];
|
|
4196
4271
|
function visitLoader(candidate) {
|
|
4197
|
-
if (visitedLoaders.has(candidate))
|
|
4272
|
+
if (visitedLoaders.has(candidate))
|
|
4273
|
+
return;
|
|
4198
4274
|
visitedLoaders.add(candidate);
|
|
4199
4275
|
availableLoaders.set(candidate.id, candidate);
|
|
4200
4276
|
for (const [name, dependency] of Object.entries(candidate.subloaders || {})) {
|
|
@@ -4218,14 +4294,13 @@ var __exports__ = (() => {
|
|
|
4218
4294
|
}
|
|
4219
4295
|
} : {}
|
|
4220
4296
|
};
|
|
4221
|
-
const serializedOptions = JSON.parse(
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
);
|
|
4297
|
+
const serializedOptions = JSON.parse(JSON.stringify(optionsToSerialize, (_key, value) => {
|
|
4298
|
+
if (typeof Headers !== "undefined" && value instanceof Headers)
|
|
4299
|
+
return Object.fromEntries(value.entries());
|
|
4300
|
+
if (typeof AbortSignal !== "undefined" && value instanceof AbortSignal)
|
|
4301
|
+
return void 0;
|
|
4302
|
+
return typeof value === "bigint" ? null : value;
|
|
4303
|
+
}));
|
|
4229
4304
|
restoreBigIntOptions(optionsToSerialize, serializedOptions);
|
|
4230
4305
|
if (serializedOptions.core?.worker === "auto") {
|
|
4231
4306
|
serializedOptions.core.worker = true;
|
|
@@ -4240,28 +4315,21 @@ var __exports__ = (() => {
|
|
|
4240
4315
|
};
|
|
4241
4316
|
}
|
|
4242
4317
|
function restoreBigIntOptions(original, serialized) {
|
|
4243
|
-
if (!serialized || typeof serialized !== "object")
|
|
4318
|
+
if (!serialized || typeof serialized !== "object")
|
|
4319
|
+
return;
|
|
4244
4320
|
for (const key of Object.keys(serialized)) {
|
|
4245
4321
|
const value = original?.[key];
|
|
4246
|
-
if (typeof value === "bigint")
|
|
4247
|
-
|
|
4322
|
+
if (typeof value === "bigint")
|
|
4323
|
+
serialized[key] = value;
|
|
4324
|
+
else
|
|
4325
|
+
restoreBigIntOptions(value, serialized[key]);
|
|
4248
4326
|
}
|
|
4249
4327
|
}
|
|
4250
4328
|
function getSerializableLoaderContext(context) {
|
|
4251
4329
|
if (!context) {
|
|
4252
4330
|
return {};
|
|
4253
4331
|
}
|
|
4254
|
-
const {
|
|
4255
|
-
fetch: fetch2,
|
|
4256
|
-
loaders,
|
|
4257
|
-
coreApi: coreApi2,
|
|
4258
|
-
signal,
|
|
4259
|
-
reportProgress: reportProgress2,
|
|
4260
|
-
_parse,
|
|
4261
|
-
_parseSync,
|
|
4262
|
-
_parseInBatches,
|
|
4263
|
-
...serializableContext
|
|
4264
|
-
} = context;
|
|
4332
|
+
const { fetch: fetch2, loaders, coreApi: coreApi2, signal, reportProgress: reportProgress2, _parse, _parseSync, _parseInBatches, ...serializableContext } = context;
|
|
4265
4333
|
return JSON.parse(JSON.stringify(serializableContext));
|
|
4266
4334
|
}
|
|
4267
4335
|
function shouldParseCSVWithWorker(options) {
|
|
@@ -4275,20 +4343,17 @@ var __exports__ = (() => {
|
|
|
4275
4343
|
return logger === null || logger instanceof NullLog;
|
|
4276
4344
|
}
|
|
4277
4345
|
|
|
4278
|
-
//
|
|
4346
|
+
// dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js
|
|
4279
4347
|
function canEncodeWithWorker(writer, options) {
|
|
4280
4348
|
const nodeWorkers = options?._nodeWorkers ?? options?.core?._nodeWorkers;
|
|
4281
4349
|
const useWorkers = options?.worker ?? options?.core?.worker;
|
|
4282
4350
|
if (!isBrowser && !nodeWorkers) {
|
|
4283
4351
|
return false;
|
|
4284
4352
|
}
|
|
4285
|
-
return canProcessOnWorker2(
|
|
4286
|
-
{ ...writer, options: writer.options || {} },
|
|
4287
|
-
{ worker: Boolean(useWorkers), _nodeWorkers: Boolean(nodeWorkers) }
|
|
4288
|
-
);
|
|
4353
|
+
return canProcessOnWorker2({ ...writer, options: writer.options || {} }, { worker: Boolean(useWorkers), _nodeWorkers: Boolean(nodeWorkers) });
|
|
4289
4354
|
}
|
|
4290
4355
|
|
|
4291
|
-
//
|
|
4356
|
+
// dist/loader-utils/lib/binary-utils/array-buffer-utils.js
|
|
4292
4357
|
function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
|
|
4293
4358
|
byteLength = byteLength || arrayBuffer1.byteLength;
|
|
4294
4359
|
if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
|
|
@@ -4307,9 +4372,7 @@ var __exports__ = (() => {
|
|
|
4307
4372
|
return concatenateArrayBuffersFromArray(sources);
|
|
4308
4373
|
}
|
|
4309
4374
|
function concatenateArrayBuffersFromArray(sources) {
|
|
4310
|
-
const sourceArrays = sources.map(
|
|
4311
|
-
(source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2
|
|
4312
|
-
);
|
|
4375
|
+
const sourceArrays = sources.map((source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2);
|
|
4313
4376
|
const byteLength = sourceArrays.reduce((length, typedArray) => length + typedArray.byteLength, 0);
|
|
4314
4377
|
const result = new Uint8Array(byteLength);
|
|
4315
4378
|
let offset = 0;
|
|
@@ -4320,20 +4383,18 @@ var __exports__ = (() => {
|
|
|
4320
4383
|
return result.buffer;
|
|
4321
4384
|
}
|
|
4322
4385
|
|
|
4323
|
-
//
|
|
4386
|
+
// dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.js
|
|
4324
4387
|
function encodeArrayBufferToBase64(arrayBuffer) {
|
|
4325
4388
|
const bytes = new Uint8Array(arrayBuffer);
|
|
4326
4389
|
const encodedChunks = [];
|
|
4327
4390
|
const chunkByteLength = 3 * 4096;
|
|
4328
4391
|
for (let byteOffset = 0; byteOffset < bytes.length; byteOffset += chunkByteLength) {
|
|
4329
|
-
encodedChunks.push(
|
|
4330
|
-
btoa(String.fromCharCode(...bytes.subarray(byteOffset, byteOffset + chunkByteLength)))
|
|
4331
|
-
);
|
|
4392
|
+
encodedChunks.push(btoa(String.fromCharCode(...bytes.subarray(byteOffset, byteOffset + chunkByteLength))));
|
|
4332
4393
|
}
|
|
4333
4394
|
return encodedChunks.join("");
|
|
4334
4395
|
}
|
|
4335
4396
|
|
|
4336
|
-
//
|
|
4397
|
+
// dist/loader-utils/lib/iterators/text-iterators.js
|
|
4337
4398
|
async function* makeTextDecoderIterator(arrayBufferIterator, options = {}) {
|
|
4338
4399
|
const textDecoder = new TextDecoder(void 0, options);
|
|
4339
4400
|
for await (const arrayBuffer of arrayBufferIterator) {
|
|
@@ -4371,7 +4432,7 @@ var __exports__ = (() => {
|
|
|
4371
4432
|
}
|
|
4372
4433
|
}
|
|
4373
4434
|
|
|
4374
|
-
//
|
|
4435
|
+
// dist/loader-utils/lib/iterators/async-iteration.js
|
|
4375
4436
|
async function forEach(iterable, visitor) {
|
|
4376
4437
|
const iterator = toAsyncIterator(iterable);
|
|
4377
4438
|
while (true) {
|
|
@@ -4634,7 +4695,7 @@ var __exports__ = (() => {
|
|
|
4634
4695
|
}
|
|
4635
4696
|
};
|
|
4636
4697
|
|
|
4637
|
-
//
|
|
4698
|
+
// dist/loader-utils/lib/request-utils/request-scheduler.js
|
|
4638
4699
|
var STAT_QUEUED_REQUESTS = "Queued Requests";
|
|
4639
4700
|
var STAT_ACTIVE_REQUESTS = "Active Requests";
|
|
4640
4701
|
var STAT_CANCELLED_REQUESTS = "Cancelled Requests";
|
|
@@ -4789,14 +4850,14 @@ var __exports__ = (() => {
|
|
|
4789
4850
|
}
|
|
4790
4851
|
};
|
|
4791
4852
|
|
|
4792
|
-
//
|
|
4853
|
+
// dist/loader-utils/lib/request-utils/authentication.js
|
|
4793
4854
|
function resolveCredentials(credentials, authentications = []) {
|
|
4794
|
-
if (credentials.every(isAuthentication))
|
|
4855
|
+
if (credentials.every(isAuthentication))
|
|
4856
|
+
return credentials;
|
|
4795
4857
|
return credentials.map((credential, index) => {
|
|
4796
|
-
if (isAuthentication(credential))
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
);
|
|
4858
|
+
if (isAuthentication(credential))
|
|
4859
|
+
return credential;
|
|
4860
|
+
const AuthenticationClass = authentications.find((authentication2) => authentication2.type === credential?.type);
|
|
4800
4861
|
if (!AuthenticationClass) {
|
|
4801
4862
|
throw new Error(`No authentication class registered for credential at index ${index}.`);
|
|
4802
4863
|
}
|
|
@@ -4813,9 +4874,11 @@ var __exports__ = (() => {
|
|
|
4813
4874
|
});
|
|
4814
4875
|
}
|
|
4815
4876
|
function resolveAuthenticationOptions(options) {
|
|
4816
|
-
if (!options.core?.credentials?.length)
|
|
4877
|
+
if (!options.core?.credentials?.length)
|
|
4878
|
+
return options;
|
|
4817
4879
|
const credentials = resolveCredentials(options.core.credentials, options.core.authentications);
|
|
4818
|
-
if (credentials === options.core.credentials)
|
|
4880
|
+
if (credentials === options.core.credentials)
|
|
4881
|
+
return options;
|
|
4819
4882
|
return { ...options, core: { ...options.core, credentials } };
|
|
4820
4883
|
}
|
|
4821
4884
|
async function resolveLoaderAuthenticationOptions(loader, url, options) {
|
|
@@ -4823,7 +4886,8 @@ var __exports__ = (() => {
|
|
|
4823
4886
|
return options;
|
|
4824
4887
|
}
|
|
4825
4888
|
const contributions = await loader?.getAuthentications?.(url, options);
|
|
4826
|
-
if (!contributions?.length)
|
|
4889
|
+
if (!contributions?.length)
|
|
4890
|
+
return resolveAuthenticationOptions(options);
|
|
4827
4891
|
return resolveAuthenticationOptions({
|
|
4828
4892
|
...options,
|
|
4829
4893
|
core: {
|
|
@@ -4833,47 +4897,40 @@ var __exports__ = (() => {
|
|
|
4833
4897
|
});
|
|
4834
4898
|
}
|
|
4835
4899
|
function isAuthentication(credential) {
|
|
4836
|
-
if (!credential || typeof credential !== "object")
|
|
4837
|
-
|
|
4838
|
-
if (credential.
|
|
4900
|
+
if (!credential || typeof credential !== "object")
|
|
4901
|
+
return false;
|
|
4902
|
+
if (typeof credential.id !== "string" || !Array.isArray(credential.origins))
|
|
4903
|
+
return false;
|
|
4904
|
+
if (credential.type === "request")
|
|
4905
|
+
return typeof credential.authenticate === "function";
|
|
4839
4906
|
return (credential.type === "header" || credential.type === "query-parameter") && typeof credential.name === "string" && (typeof credential.token === "string" || typeof credential.token === "function") && Array.isArray(credential.refreshStatusCodes);
|
|
4840
4907
|
}
|
|
4841
4908
|
|
|
4842
|
-
//
|
|
4909
|
+
// dist/loader-utils/lib/request-utils/request-credentials.js
|
|
4843
4910
|
var AUTHENTICATED_FETCH = /* @__PURE__ */ Symbol("loaders.gl.authenticated-fetch");
|
|
4844
4911
|
var refreshPromises = /* @__PURE__ */ new WeakMap();
|
|
4845
4912
|
function createAuthenticatedFetch(options) {
|
|
4846
4913
|
const suppliedFetch = options.fetch || ((url, requestOptions) => fetch(url, requestOptions));
|
|
4847
4914
|
const existingMetadata = suppliedFetch[AUTHENTICATED_FETCH];
|
|
4848
4915
|
const credentialResolutions = new Map(existingMetadata?.credentialResolutions);
|
|
4849
|
-
const resolvedCredentials = resolveCredentials(
|
|
4850
|
-
options.credentials.map((credential) => credentialResolutions.get(credential) || credential),
|
|
4851
|
-
options.authentications
|
|
4852
|
-
);
|
|
4916
|
+
const resolvedCredentials = resolveCredentials(options.credentials.map((credential) => credentialResolutions.get(credential) || credential), options.authentications);
|
|
4853
4917
|
options.credentials.forEach((credential, index) => {
|
|
4854
4918
|
credentialResolutions.set(credential, resolvedCredentials[index]);
|
|
4855
4919
|
});
|
|
4856
|
-
if (!options.fetchOptions && (!resolvedCredentials.length || existingMetadata?.credentials.length === resolvedCredentials.length && resolvedCredentials.every(
|
|
4857
|
-
(credential, index) => credential === existingMetadata.credentials[index]
|
|
4858
|
-
)))
|
|
4920
|
+
if (!options.fetchOptions && (!resolvedCredentials.length || existingMetadata?.credentials.length === resolvedCredentials.length && resolvedCredentials.every((credential, index) => credential === existingMetadata.credentials[index])))
|
|
4859
4921
|
return suppliedFetch;
|
|
4860
4922
|
const baseFetch = existingMetadata?.fetch || suppliedFetch;
|
|
4861
4923
|
const credentials = existingMetadata ? [.../* @__PURE__ */ new Set([...resolvedCredentials, ...existingMetadata.credentials])] : resolvedCredentials;
|
|
4862
|
-
const fetchOptions = mergeFetchOptions(
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
)
|
|
4866
|
-
|
|
4867
|
-
(credential) => credential.type !== "request"
|
|
4868
|
-
);
|
|
4869
|
-
const requestCredentials = credentials.filter(
|
|
4870
|
-
(credential) => credential.type === "request"
|
|
4871
|
-
);
|
|
4872
|
-
for (const credential of requestCredentials) normalizeRequestOrigins(credential.origins);
|
|
4924
|
+
const fetchOptions = mergeFetchOptions(existingMetadata?.fetchOptions || {}, options.fetchOptions);
|
|
4925
|
+
const tokenCredentials = credentials.filter((credential) => credential.type !== "request");
|
|
4926
|
+
const requestCredentials = credentials.filter((credential) => credential.type === "request");
|
|
4927
|
+
for (const credential of requestCredentials)
|
|
4928
|
+
normalizeRequestOrigins(credential.origins);
|
|
4873
4929
|
const authenticatedFetch = async (url, requestOptions = {}) => {
|
|
4874
4930
|
requestOptions = mergeFetchOptions(fetchOptions, requestOptions);
|
|
4875
4931
|
requestOptions.signal?.throwIfAborted();
|
|
4876
|
-
if (!credentials.length)
|
|
4932
|
+
if (!credentials.length)
|
|
4933
|
+
return baseFetch(url, requestOptions);
|
|
4877
4934
|
const resolvedURL = parseHTTPURL(url);
|
|
4878
4935
|
const authorization = resolvedURL ? await authorizeRequest(resolvedURL, requestOptions, tokenCredentials) : { url, options: requestOptions, credentials: [] };
|
|
4879
4936
|
const signedRequest = await authenticateRequest(authorization, requestCredentials, "request");
|
|
@@ -4884,35 +4941,23 @@ var __exports__ = (() => {
|
|
|
4884
4941
|
if (typeof credential.token === "function" && (isReplayableRequest(requestOptions) || credential.canReplayRequest?.(url, requestOptions)) && (isReplayableRequest(signedRequest.options) || credential.canReplayRequest?.(signedRequest.url, signedRequest.options)) && (credential.refreshStatusCodes.includes(response.status) || await credential.shouldRefresh?.(response)))
|
|
4885
4942
|
refreshableCredentials.push(resolvedCredential);
|
|
4886
4943
|
}
|
|
4887
|
-
const shouldRetrySignature = isReplayableRequest(requestOptions) && isReplayableRequest(signedRequest.options) && signedRequest.credentials.some(
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
if (!refreshableCredentials.length && !shouldRetrySignature) return response;
|
|
4944
|
+
const shouldRetrySignature = isReplayableRequest(requestOptions) && isReplayableRequest(signedRequest.options) && signedRequest.credentials.some((credential) => credential.refreshStatusCodes?.includes(response.status));
|
|
4945
|
+
if (!refreshableCredentials.length && !shouldRetrySignature)
|
|
4946
|
+
return response;
|
|
4891
4947
|
requestOptions.signal?.throwIfAborted();
|
|
4892
4948
|
const refreshedTokens = /* @__PURE__ */ new Map();
|
|
4893
|
-
await Promise.all(
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
)
|
|
4899
|
-
|
|
4949
|
+
await Promise.all(refreshableCredentials.map(async ({ credential }) => {
|
|
4950
|
+
const token = await refreshCredential(credential, url, response);
|
|
4951
|
+
if (token)
|
|
4952
|
+
refreshedTokens.set(credential, token);
|
|
4953
|
+
}));
|
|
4954
|
+
if (!refreshedTokens.size && !shouldRetrySignature)
|
|
4955
|
+
return response;
|
|
4900
4956
|
await response.body?.cancel().catch(() => {
|
|
4901
4957
|
});
|
|
4902
4958
|
requestOptions.signal?.throwIfAborted();
|
|
4903
|
-
const replayAuthorization = resolvedURL ? await authorizeRequest(
|
|
4904
|
-
|
|
4905
|
-
requestOptions,
|
|
4906
|
-
tokenCredentials,
|
|
4907
|
-
refreshedTokens,
|
|
4908
|
-
authorization.credentials
|
|
4909
|
-
) : { url, options: requestOptions };
|
|
4910
|
-
const replayRequest = await authenticateRequest(
|
|
4911
|
-
replayAuthorization,
|
|
4912
|
-
requestCredentials,
|
|
4913
|
-
"retry",
|
|
4914
|
-
response
|
|
4915
|
-
);
|
|
4959
|
+
const replayAuthorization = resolvedURL ? await authorizeRequest(resolvedURL, requestOptions, tokenCredentials, refreshedTokens, authorization.credentials) : { url, options: requestOptions };
|
|
4960
|
+
const replayRequest = await authenticateRequest(replayAuthorization, requestCredentials, "retry", response);
|
|
4916
4961
|
return baseFetch(replayRequest.url, replayRequest.options);
|
|
4917
4962
|
};
|
|
4918
4963
|
Object.defineProperty(authenticatedFetch, AUTHENTICATED_FETCH, {
|
|
@@ -4939,7 +4984,8 @@ var __exports__ = (() => {
|
|
|
4939
4984
|
const signal = request.options.signal;
|
|
4940
4985
|
for (const credential of credentials) {
|
|
4941
4986
|
const origin = getRequestOrigin(request.url);
|
|
4942
|
-
if (!origin || !normalizeRequestOrigins(credential.origins).includes(origin))
|
|
4987
|
+
if (!origin || !normalizeRequestOrigins(credential.origins).includes(origin))
|
|
4988
|
+
continue;
|
|
4943
4989
|
signal?.throwIfAborted();
|
|
4944
4990
|
const authenticatedRequest = await credential.authenticate({
|
|
4945
4991
|
url: request.url,
|
|
@@ -4962,7 +5008,8 @@ var __exports__ = (() => {
|
|
|
4962
5008
|
function getRequestOrigin(url) {
|
|
4963
5009
|
try {
|
|
4964
5010
|
const parsedURL = new URL(url);
|
|
4965
|
-
if (!parsedURL.host || parsedURL.username || parsedURL.password)
|
|
5011
|
+
if (!parsedURL.host || parsedURL.username || parsedURL.password)
|
|
5012
|
+
return null;
|
|
4966
5013
|
return parsedURL.origin !== "null" ? parsedURL.origin : `${parsedURL.protocol}//${parsedURL.host}`;
|
|
4967
5014
|
} catch {
|
|
4968
5015
|
return null;
|
|
@@ -4989,11 +5036,10 @@ var __exports__ = (() => {
|
|
|
4989
5036
|
const url = new URL(sourceURL);
|
|
4990
5037
|
const headers = new Headers(requestOptions.headers);
|
|
4991
5038
|
const resolvedCredentials = [];
|
|
4992
|
-
const previousTokens = new Map(
|
|
4993
|
-
previousCredentials.map(({ credential, token }) => [credential, token])
|
|
4994
|
-
);
|
|
5039
|
+
const previousTokens = new Map(previousCredentials.map(({ credential, token }) => [credential, token]));
|
|
4995
5040
|
for (const credential of credentials) {
|
|
4996
|
-
if (!credential.origins.includes(url.origin))
|
|
5041
|
+
if (!credential.origins.includes(url.origin))
|
|
5042
|
+
continue;
|
|
4997
5043
|
const overrideToken = tokenOverrides.get(credential);
|
|
4998
5044
|
const previousToken = previousTokens.get(credential);
|
|
4999
5045
|
const ownsQueryParameter = credential.type === "query-parameter" && previousToken !== void 0;
|
|
@@ -5002,7 +5048,8 @@ var __exports__ = (() => {
|
|
|
5002
5048
|
continue;
|
|
5003
5049
|
}
|
|
5004
5050
|
const token = overrideToken ?? previousToken ?? await resolveToken(credential.token, { url: sourceURL.toString(), reason: "request" });
|
|
5005
|
-
if (!token)
|
|
5051
|
+
if (!token)
|
|
5052
|
+
continue;
|
|
5006
5053
|
if (credential.type === "query-parameter") {
|
|
5007
5054
|
url.searchParams.set(credential.name, token);
|
|
5008
5055
|
} else {
|
|
@@ -5018,15 +5065,14 @@ var __exports__ = (() => {
|
|
|
5018
5065
|
}
|
|
5019
5066
|
async function refreshCredential(credential, url, response) {
|
|
5020
5067
|
const existingPromise = refreshPromises.get(credential);
|
|
5021
|
-
if (existingPromise)
|
|
5068
|
+
if (existingPromise)
|
|
5069
|
+
return existingPromise;
|
|
5022
5070
|
const tokenProvider = credential.token;
|
|
5023
|
-
const promise = Promise.resolve(
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
})
|
|
5029
|
-
).finally(() => refreshPromises.delete(credential));
|
|
5071
|
+
const promise = Promise.resolve(tokenProvider({
|
|
5072
|
+
url,
|
|
5073
|
+
reason: "refresh",
|
|
5074
|
+
response: { status: response.status, headers: response.headers }
|
|
5075
|
+
})).finally(() => refreshPromises.delete(credential));
|
|
5030
5076
|
refreshPromises.set(credential, promise);
|
|
5031
5077
|
return promise;
|
|
5032
5078
|
}
|
|
@@ -5043,11 +5089,12 @@ var __exports__ = (() => {
|
|
|
5043
5089
|
}
|
|
5044
5090
|
function isReplayableRequest(options) {
|
|
5045
5091
|
const method = (options.method || "GET").toUpperCase();
|
|
5046
|
-
if (!["GET", "HEAD", "OPTIONS", "PUT", "DELETE"].includes(method))
|
|
5092
|
+
if (!["GET", "HEAD", "OPTIONS", "PUT", "DELETE"].includes(method))
|
|
5093
|
+
return false;
|
|
5047
5094
|
return !(options.body && typeof ReadableStream !== "undefined" && options.body instanceof ReadableStream);
|
|
5048
5095
|
}
|
|
5049
5096
|
|
|
5050
|
-
//
|
|
5097
|
+
// dist/loader-utils/lib/path-utils/file-aliases.js
|
|
5051
5098
|
var pathPrefix = "";
|
|
5052
5099
|
var fileAliases = {};
|
|
5053
5100
|
function setPathPrefix(prefix) {
|
|
@@ -5069,7 +5116,7 @@ var __exports__ = (() => {
|
|
|
5069
5116
|
return filename2;
|
|
5070
5117
|
}
|
|
5071
5118
|
|
|
5072
|
-
//
|
|
5119
|
+
// dist/loader-utils/lib/path-utils/path.js
|
|
5073
5120
|
var path_exports = {};
|
|
5074
5121
|
__export(path_exports, {
|
|
5075
5122
|
dirname: () => dirname,
|
|
@@ -5078,7 +5125,7 @@ var __exports__ = (() => {
|
|
|
5078
5125
|
resolve: () => resolve
|
|
5079
5126
|
});
|
|
5080
5127
|
|
|
5081
|
-
//
|
|
5128
|
+
// dist/loader-utils/lib/path-utils/get-cwd.js
|
|
5082
5129
|
function getCWD() {
|
|
5083
5130
|
if (typeof process !== "undefined" && typeof process.cwd !== "undefined") {
|
|
5084
5131
|
return process.cwd();
|
|
@@ -5087,7 +5134,7 @@ var __exports__ = (() => {
|
|
|
5087
5134
|
return pathname?.slice(0, pathname.lastIndexOf("/") + 1) || "";
|
|
5088
5135
|
}
|
|
5089
5136
|
|
|
5090
|
-
//
|
|
5137
|
+
// dist/loader-utils/lib/path-utils/path.js
|
|
5091
5138
|
function filename(url) {
|
|
5092
5139
|
const slashIndex = url ? url.lastIndexOf("/") : -1;
|
|
5093
5140
|
return slashIndex >= 0 ? url.substr(slashIndex + 1) : url;
|
|
@@ -5212,35 +5259,15 @@ var __exports__ = (() => {
|
|
|
5212
5259
|
return res;
|
|
5213
5260
|
}
|
|
5214
5261
|
|
|
5215
|
-
//
|
|
5216
|
-
|
|
5217
|
-
var JSONLoader = {
|
|
5218
|
-
dataType: null,
|
|
5219
|
-
batchType: null,
|
|
5220
|
-
name: "JSON",
|
|
5221
|
-
id: "json",
|
|
5222
|
-
module: "json",
|
|
5223
|
-
version: VERSION5,
|
|
5224
|
-
encoding: "json",
|
|
5225
|
-
format: "json",
|
|
5226
|
-
extensions: ["json", "geojson"],
|
|
5227
|
-
mimeTypes: ["application/json"],
|
|
5228
|
-
category: "json",
|
|
5229
|
-
text: true,
|
|
5230
|
-
parseTextSync,
|
|
5231
|
-
parse: async (arrayBuffer) => parseTextSync(new TextDecoder().decode(arrayBuffer)),
|
|
5232
|
-
options: {}
|
|
5233
|
-
};
|
|
5234
|
-
function parseTextSync(text) {
|
|
5235
|
-
return JSON.parse(text);
|
|
5236
|
-
}
|
|
5262
|
+
// dist/loader-utils/index.js
|
|
5263
|
+
init_json_loader();
|
|
5237
5264
|
|
|
5238
|
-
//
|
|
5265
|
+
// dist/loader-utils/lib/node/buffer.browser.js
|
|
5239
5266
|
function toArrayBuffer(buffer) {
|
|
5240
5267
|
return buffer;
|
|
5241
5268
|
}
|
|
5242
5269
|
|
|
5243
|
-
//
|
|
5270
|
+
// dist/loader-utils/lib/binary-utils/memory-conversion-utils.js
|
|
5244
5271
|
function isBuffer(value) {
|
|
5245
5272
|
return value && typeof value === "object" && value.isBuffer;
|
|
5246
5273
|
}
|
|
@@ -5297,7 +5324,7 @@ var __exports__ = (() => {
|
|
|
5297
5324
|
return new Uint8Array(data);
|
|
5298
5325
|
}
|
|
5299
5326
|
|
|
5300
|
-
//
|
|
5327
|
+
// dist/loader-utils/lib/files/blob-file.js
|
|
5301
5328
|
var BlobFile = class {
|
|
5302
5329
|
handle;
|
|
5303
5330
|
size;
|
|
@@ -5330,7 +5357,7 @@ var __exports__ = (() => {
|
|
|
5330
5357
|
}
|
|
5331
5358
|
};
|
|
5332
5359
|
|
|
5333
|
-
//
|
|
5360
|
+
// dist/loader-utils/lib/files/node-file-facade.js
|
|
5334
5361
|
var NOT_IMPLEMENTED = new Error("Not implemented");
|
|
5335
5362
|
var NodeFileFacade = class {
|
|
5336
5363
|
handle;
|
|
@@ -5344,9 +5371,7 @@ var __exports__ = (() => {
|
|
|
5344
5371
|
if (isBrowser) {
|
|
5345
5372
|
throw new Error("Can't instantiate NodeFile in browser.");
|
|
5346
5373
|
}
|
|
5347
|
-
throw new Error(
|
|
5348
|
-
"Can't instantiate NodeFile. Make sure to import @loaders.gl/core/polyfills first."
|
|
5349
|
-
);
|
|
5374
|
+
throw new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/core/polyfills first.");
|
|
5350
5375
|
}
|
|
5351
5376
|
/** Read data */
|
|
5352
5377
|
async read(start, length) {
|
|
@@ -5373,7 +5398,7 @@ var __exports__ = (() => {
|
|
|
5373
5398
|
}
|
|
5374
5399
|
};
|
|
5375
5400
|
|
|
5376
|
-
//
|
|
5401
|
+
// dist/loader-utils/lib/pace-batch-iterator.js
|
|
5377
5402
|
function validateBatchDeliveryRate(rate) {
|
|
5378
5403
|
if (!Number.isFinite(rate) || rate < 0) {
|
|
5379
5404
|
throw new RangeError("core.batchMaxRowsPerSecond must be a finite nonnegative number");
|
|
@@ -5419,7 +5444,7 @@ var __exports__ = (() => {
|
|
|
5419
5444
|
});
|
|
5420
5445
|
}
|
|
5421
5446
|
|
|
5422
|
-
//
|
|
5447
|
+
// dist/lib/fetch/fetch-error.js
|
|
5423
5448
|
var FetchError = class extends Error {
|
|
5424
5449
|
constructor(message, info) {
|
|
5425
5450
|
super(message);
|
|
@@ -5435,7 +5460,7 @@ var __exports__ = (() => {
|
|
|
5435
5460
|
response;
|
|
5436
5461
|
};
|
|
5437
5462
|
|
|
5438
|
-
//
|
|
5463
|
+
// dist/lib/utils/mime-type-utils.js
|
|
5439
5464
|
var DATA_URL_PATTERN = /^data:([-\w.]+\/[-\w.+]+)(;|,)/;
|
|
5440
5465
|
var MIME_TYPE_PATTERN = /^([-\w.]+\/[-\w.+]+)/;
|
|
5441
5466
|
function compareMIMETypes(mimeType1, mimeType2) {
|
|
@@ -5459,7 +5484,7 @@ var __exports__ = (() => {
|
|
|
5459
5484
|
return "";
|
|
5460
5485
|
}
|
|
5461
5486
|
|
|
5462
|
-
//
|
|
5487
|
+
// dist/lib/utils/url-utils.js
|
|
5463
5488
|
var QUERY_STRING_PATTERN = /\?.*/;
|
|
5464
5489
|
function extractQueryString(url) {
|
|
5465
5490
|
const matches4 = url.match(QUERY_STRING_PATTERN);
|
|
@@ -5477,7 +5502,7 @@ var __exports__ = (() => {
|
|
|
5477
5502
|
return `${urlStart}...${urlEnd}`;
|
|
5478
5503
|
}
|
|
5479
5504
|
|
|
5480
|
-
//
|
|
5505
|
+
// dist/lib/utils/resource-utils.js
|
|
5481
5506
|
function getResourceUrl(resource) {
|
|
5482
5507
|
if (isResponse(resource)) {
|
|
5483
5508
|
return resource.url;
|
|
@@ -5526,7 +5551,7 @@ var __exports__ = (() => {
|
|
|
5526
5551
|
return -1;
|
|
5527
5552
|
}
|
|
5528
5553
|
|
|
5529
|
-
//
|
|
5554
|
+
// dist/lib/utils/response-utils.js
|
|
5530
5555
|
async function makeResponse(resource) {
|
|
5531
5556
|
if (isResponse(resource)) {
|
|
5532
5557
|
return resource;
|
|
@@ -5595,7 +5620,7 @@ var __exports__ = (() => {
|
|
|
5595
5620
|
return null;
|
|
5596
5621
|
}
|
|
5597
5622
|
|
|
5598
|
-
//
|
|
5623
|
+
// dist/lib/fetch/fetch-file.js
|
|
5599
5624
|
function isNodePath(url) {
|
|
5600
5625
|
return !isRequestURL(url) && !isDataURL(url);
|
|
5601
5626
|
}
|
|
@@ -5618,7 +5643,7 @@ var __exports__ = (() => {
|
|
|
5618
5643
|
return await makeResponse(urlOrData);
|
|
5619
5644
|
}
|
|
5620
5645
|
|
|
5621
|
-
//
|
|
5646
|
+
// dist/lib/fetch/read-array-buffer.js
|
|
5622
5647
|
async function readArrayBuffer(file, start, length) {
|
|
5623
5648
|
if (!(file instanceof Blob)) {
|
|
5624
5649
|
file = new Blob([file]);
|
|
@@ -5635,7 +5660,7 @@ var __exports__ = (() => {
|
|
|
5635
5660
|
});
|
|
5636
5661
|
}
|
|
5637
5662
|
|
|
5638
|
-
//
|
|
5663
|
+
// dist/lib/loader-utils/option-defaults.js
|
|
5639
5664
|
var DEFAULT_LOADER_OPTIONS = {
|
|
5640
5665
|
searchParams: void 0,
|
|
5641
5666
|
core: {
|
|
@@ -5717,7 +5742,7 @@ var __exports__ = (() => {
|
|
|
5717
5742
|
signal: "core.fetch.signal"
|
|
5718
5743
|
};
|
|
5719
5744
|
|
|
5720
|
-
//
|
|
5745
|
+
// dist/lib/loader-utils/native-arrow.js
|
|
5721
5746
|
function getShapeOptionKey(loader) {
|
|
5722
5747
|
const keys = Object.keys(loader.options || {}).filter((key) => {
|
|
5723
5748
|
const value = loader.options?.[key];
|
|
@@ -5732,9 +5757,7 @@ var __exports__ = (() => {
|
|
|
5732
5757
|
return false;
|
|
5733
5758
|
}
|
|
5734
5759
|
if (options.core?.metadata) {
|
|
5735
|
-
throw new Error(
|
|
5736
|
-
'shape: "arrow" carries metadata in the Arrow schema and does not support core.metadata envelopes'
|
|
5737
|
-
);
|
|
5760
|
+
throw new Error('shape: "arrow" carries metadata in the Arrow schema and does not support core.metadata envelopes');
|
|
5738
5761
|
}
|
|
5739
5762
|
return true;
|
|
5740
5763
|
}
|
|
@@ -5754,17 +5777,13 @@ var __exports__ = (() => {
|
|
|
5754
5777
|
}
|
|
5755
5778
|
}
|
|
5756
5779
|
function isArrowTable(value) {
|
|
5757
|
-
return Boolean(
|
|
5758
|
-
value && typeof value === "object" && "schema" in value && "batches" in value && Array.isArray(value.batches) && "numRows" in value && typeof value.numRows === "number" && "getChildAt" in value && typeof value.getChildAt === "function"
|
|
5759
|
-
);
|
|
5780
|
+
return Boolean(value && typeof value === "object" && "schema" in value && "batches" in value && Array.isArray(value.batches) && "numRows" in value && typeof value.numRows === "number" && "getChildAt" in value && typeof value.getChildAt === "function");
|
|
5760
5781
|
}
|
|
5761
5782
|
function isArrowRecordBatch(value) {
|
|
5762
|
-
return Boolean(
|
|
5763
|
-
value && typeof value === "object" && value[/* @__PURE__ */ Symbol.for("apache-arrow/RecordBatch")] === true
|
|
5764
|
-
);
|
|
5783
|
+
return Boolean(value && typeof value === "object" && value[/* @__PURE__ */ Symbol.for("apache-arrow/RecordBatch")] === true);
|
|
5765
5784
|
}
|
|
5766
5785
|
|
|
5767
|
-
//
|
|
5786
|
+
// dist/lib/loader-utils/option-utils.js
|
|
5768
5787
|
function applySearchParamsToUrl(url, options) {
|
|
5769
5788
|
const searchParams = options?.searchParams;
|
|
5770
5789
|
if (!searchParams || Object.keys(searchParams).length === 0 || /^(?:data|blob):/i.test(url)) {
|
|
@@ -5845,16 +5864,12 @@ var __exports__ = (() => {
|
|
|
5845
5864
|
if (!(key in defaultOptions) && !isLifecycleOption && !isWorkerUrlOption) {
|
|
5846
5865
|
if (key in deprecatedOptions) {
|
|
5847
5866
|
if (log2.level > 0) {
|
|
5848
|
-
log2.warn(
|
|
5849
|
-
`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`
|
|
5850
|
-
)();
|
|
5867
|
+
log2.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
5851
5868
|
}
|
|
5852
5869
|
} else if (!isSubOptions) {
|
|
5853
5870
|
if (log2.level > 0) {
|
|
5854
5871
|
const suggestion = findSimilarOption(key, loaders);
|
|
5855
|
-
log2.warn(
|
|
5856
|
-
`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`
|
|
5857
|
-
)();
|
|
5872
|
+
log2.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
5858
5873
|
}
|
|
5859
5874
|
}
|
|
5860
5875
|
}
|
|
@@ -5959,7 +5974,7 @@ var __exports__ = (() => {
|
|
|
5959
5974
|
return clonedOptions;
|
|
5960
5975
|
}
|
|
5961
5976
|
|
|
5962
|
-
//
|
|
5977
|
+
// dist/lib/api/loader-options.js
|
|
5963
5978
|
function compareLoaderOptions(left, right) {
|
|
5964
5979
|
return Object.is(left, right) || compareOptionValues(left, right, /* @__PURE__ */ new WeakMap());
|
|
5965
5980
|
}
|
|
@@ -5994,17 +6009,13 @@ var __exports__ = (() => {
|
|
|
5994
6009
|
const rightKeys = getEnumerableKeys(right);
|
|
5995
6010
|
const leftOptions = left;
|
|
5996
6011
|
const rightOptions = right;
|
|
5997
|
-
return leftKeys.length === rightKeys.length && leftKeys.every(
|
|
5998
|
-
(key) => Object.prototype.propertyIsEnumerable.call(right, key) && compareOptionValues(leftOptions[key], rightOptions[key], visited)
|
|
5999
|
-
);
|
|
6012
|
+
return leftKeys.length === rightKeys.length && leftKeys.every((key) => Object.prototype.propertyIsEnumerable.call(right, key) && compareOptionValues(leftOptions[key], rightOptions[key], visited));
|
|
6000
6013
|
}
|
|
6001
6014
|
function getEnumerableKeys(value) {
|
|
6002
|
-
return Reflect.ownKeys(value).filter(
|
|
6003
|
-
(key) => Object.prototype.propertyIsEnumerable.call(value, key)
|
|
6004
|
-
);
|
|
6015
|
+
return Reflect.ownKeys(value).filter((key) => Object.prototype.propertyIsEnumerable.call(value, key));
|
|
6005
6016
|
}
|
|
6006
6017
|
|
|
6007
|
-
//
|
|
6018
|
+
// dist/lib/loader-utils/normalize-loader.js
|
|
6008
6019
|
function isLoaderObject(loader) {
|
|
6009
6020
|
if (!loader) {
|
|
6010
6021
|
return false;
|
|
@@ -6036,7 +6047,7 @@ var __exports__ = (() => {
|
|
|
6036
6047
|
return loader;
|
|
6037
6048
|
}
|
|
6038
6049
|
|
|
6039
|
-
//
|
|
6050
|
+
// dist/lib/api/register-loaders.js
|
|
6040
6051
|
var getGlobalLoaderRegistry = () => {
|
|
6041
6052
|
const state = getGlobalLoaderState();
|
|
6042
6053
|
state.loaderRegistry = state.loaderRegistry || [];
|
|
@@ -6060,7 +6071,7 @@ var __exports__ = (() => {
|
|
|
6060
6071
|
state.loaderRegistry = [];
|
|
6061
6072
|
}
|
|
6062
6073
|
|
|
6063
|
-
//
|
|
6074
|
+
// dist/lib/api/select-loader.js
|
|
6064
6075
|
var EXT_PATTERN = /\.([^.]+)$/;
|
|
6065
6076
|
async function selectLoader(data, loaders = [], options, context, operation = "parse") {
|
|
6066
6077
|
if (!validHTTPResponse(data)) {
|
|
@@ -6091,9 +6102,7 @@ var __exports__ = (() => {
|
|
|
6091
6102
|
}
|
|
6092
6103
|
function mayContainText(response) {
|
|
6093
6104
|
const mimeType = getResourceMIMEType(response);
|
|
6094
|
-
return Boolean(
|
|
6095
|
-
mimeType && (mimeType.startsWith("text/") || mimeType === "application/json" || mimeType.endsWith("+json"))
|
|
6096
|
-
);
|
|
6105
|
+
return Boolean(mimeType && (mimeType.startsWith("text/") || mimeType === "application/json" || mimeType.endsWith("+json")));
|
|
6097
6106
|
}
|
|
6098
6107
|
function selectLoaderSync(data, loaders = [], options, context, operation = "parse") {
|
|
6099
6108
|
if (!validHTTPResponse(data)) {
|
|
@@ -6306,7 +6315,7 @@ var __exports__ = (() => {
|
|
|
6306
6315
|
return magic;
|
|
6307
6316
|
}
|
|
6308
6317
|
|
|
6309
|
-
//
|
|
6318
|
+
// dist/iterators/make-iterator/make-string-iterator.js
|
|
6310
6319
|
var DEFAULT_CHUNK_SIZE = 256 * 1024;
|
|
6311
6320
|
function* makeStringIterator(string, options) {
|
|
6312
6321
|
const chunkSize = options?.chunkSize || DEFAULT_CHUNK_SIZE;
|
|
@@ -6320,7 +6329,7 @@ var __exports__ = (() => {
|
|
|
6320
6329
|
}
|
|
6321
6330
|
}
|
|
6322
6331
|
|
|
6323
|
-
//
|
|
6332
|
+
// dist/iterators/make-iterator/make-array-buffer-iterator.js
|
|
6324
6333
|
var DEFAULT_CHUNK_SIZE2 = 256 * 1024;
|
|
6325
6334
|
function* makeArrayBufferIterator(arrayBuffer, options = {}) {
|
|
6326
6335
|
const { chunkSize = DEFAULT_CHUNK_SIZE2 } = options;
|
|
@@ -6336,7 +6345,7 @@ var __exports__ = (() => {
|
|
|
6336
6345
|
}
|
|
6337
6346
|
}
|
|
6338
6347
|
|
|
6339
|
-
//
|
|
6348
|
+
// dist/iterators/make-iterator/make-blob-iterator.js
|
|
6340
6349
|
var DEFAULT_CHUNK_SIZE3 = 1024 * 1024;
|
|
6341
6350
|
async function* makeBlobIterator(blob, options) {
|
|
6342
6351
|
const chunkSize = options?.chunkSize || DEFAULT_CHUNK_SIZE3;
|
|
@@ -6349,7 +6358,7 @@ var __exports__ = (() => {
|
|
|
6349
6358
|
}
|
|
6350
6359
|
}
|
|
6351
6360
|
|
|
6352
|
-
//
|
|
6361
|
+
// dist/iterators/make-iterator/make-stream-iterator.js
|
|
6353
6362
|
function makeStreamIterator(stream, options) {
|
|
6354
6363
|
return isBrowser ? makeBrowserStreamIterator(stream, options) : makeNodeStreamIterator(stream, options);
|
|
6355
6364
|
}
|
|
@@ -6415,7 +6424,7 @@ var __exports__ = (() => {
|
|
|
6415
6424
|
}
|
|
6416
6425
|
}
|
|
6417
6426
|
|
|
6418
|
-
//
|
|
6427
|
+
// dist/iterators/make-iterator/make-iterator.js
|
|
6419
6428
|
function makeIterator(data, options) {
|
|
6420
6429
|
if (typeof data === "string") {
|
|
6421
6430
|
return makeStringIterator(data, options);
|
|
@@ -6439,7 +6448,7 @@ var __exports__ = (() => {
|
|
|
6439
6448
|
throw new Error("makeIterator");
|
|
6440
6449
|
}
|
|
6441
6450
|
|
|
6442
|
-
//
|
|
6451
|
+
// dist/lib/loader-utils/get-data.js
|
|
6443
6452
|
var ERR_DATA = "Cannot convert supplied data type";
|
|
6444
6453
|
function getArrayBufferOrStringFromDataSync(data, loader, options) {
|
|
6445
6454
|
if (loader.text && typeof data === "string") {
|
|
@@ -6545,7 +6554,7 @@ var __exports__ = (() => {
|
|
|
6545
6554
|
throw new Error(ERR_DATA);
|
|
6546
6555
|
}
|
|
6547
6556
|
|
|
6548
|
-
//
|
|
6557
|
+
// dist/lib/loader-utils/get-fetch-function.js
|
|
6549
6558
|
function getFetchFunction(options, context) {
|
|
6550
6559
|
const globalOptions = getGlobalLoaderOptions();
|
|
6551
6560
|
const loaderOptions = options || globalOptions;
|
|
@@ -6570,7 +6579,7 @@ var __exports__ = (() => {
|
|
|
6570
6579
|
});
|
|
6571
6580
|
}
|
|
6572
6581
|
|
|
6573
|
-
//
|
|
6582
|
+
// dist/lib/api/load-loader.js
|
|
6574
6583
|
var loaderImplementationPromises = /* @__PURE__ */ new Map();
|
|
6575
6584
|
var loaderImplementations = /* @__PURE__ */ new Map();
|
|
6576
6585
|
async function getLoaderImplementation(loader, options, url) {
|
|
@@ -6611,8 +6620,10 @@ var __exports__ = (() => {
|
|
|
6611
6620
|
function getLoaderImplementationSync(loader, options) {
|
|
6612
6621
|
if (loader.subloaders && !preparedLoaders.has(loader)) {
|
|
6613
6622
|
const prepared = preparedDefaults.get(loader);
|
|
6614
|
-
if (prepared)
|
|
6615
|
-
|
|
6623
|
+
if (prepared)
|
|
6624
|
+
return prepared;
|
|
6625
|
+
if (!isLoaderWithParser(loader))
|
|
6626
|
+
return null;
|
|
6616
6627
|
}
|
|
6617
6628
|
if (isLoaderWithParser(loader) || !loader.preload && loader.createDataSourceSync) {
|
|
6618
6629
|
return loader;
|
|
@@ -6622,9 +6633,7 @@ var __exports__ = (() => {
|
|
|
6622
6633
|
}
|
|
6623
6634
|
function isLoaderWithParser(loader) {
|
|
6624
6635
|
const candidate = loader;
|
|
6625
|
-
return Boolean(
|
|
6626
|
-
candidate.parse || candidate.parseBlob || candidate.parseUrl || candidate.parseSync || candidate.parseInBatches || candidate.parseText || candidate.parseTextSync || candidate.parseFile || candidate.parseFileInBatches
|
|
6627
|
-
);
|
|
6636
|
+
return Boolean(candidate.parse || candidate.parseBlob || candidate.parseUrl || candidate.parseSync || candidate.parseInBatches || candidate.parseText || candidate.parseTextSync || candidate.parseFile || candidate.parseFileInBatches);
|
|
6628
6637
|
}
|
|
6629
6638
|
async function resolveLoaderImplementation(loader, options, url) {
|
|
6630
6639
|
if (loader.preload) {
|
|
@@ -6632,9 +6641,7 @@ var __exports__ = (() => {
|
|
|
6632
6641
|
if (preloadedLoader && (isLoaderWithParser(preloadedLoader) || preloadedLoader.createDataSourceSync)) {
|
|
6633
6642
|
return preloadedLoader;
|
|
6634
6643
|
}
|
|
6635
|
-
throw new Error(
|
|
6636
|
-
`${loader.id} loader preload() did not return a parser-bearing loader or a source factory`
|
|
6637
|
-
);
|
|
6644
|
+
throw new Error(`${loader.id} loader preload() did not return a parser-bearing loader or a source factory`);
|
|
6638
6645
|
}
|
|
6639
6646
|
const implementationSpecifier = getLoaderImplementationSpecifier(loader, options);
|
|
6640
6647
|
return await importLoaderImplementation(implementationSpecifier, loader.id);
|
|
@@ -6651,9 +6658,7 @@ var __exports__ = (() => {
|
|
|
6651
6658
|
}
|
|
6652
6659
|
return sourcePath;
|
|
6653
6660
|
}
|
|
6654
|
-
throw new Error(
|
|
6655
|
-
`${loader.id} loader does not provide a parser implementation. Import a parser-bearing loader directly, or use preload() before parse/load.`
|
|
6656
|
-
);
|
|
6661
|
+
throw new Error(`${loader.id} loader does not provide a parser implementation. Import a parser-bearing loader directly, or use preload() before parse/load.`);
|
|
6657
6662
|
}
|
|
6658
6663
|
function getLoaderImplementationCacheKey(loader, options) {
|
|
6659
6664
|
const loaderOptions = options?.[loader.id];
|
|
@@ -6671,22 +6676,22 @@ var __exports__ = (() => {
|
|
|
6671
6676
|
return exportValue;
|
|
6672
6677
|
}
|
|
6673
6678
|
}
|
|
6674
|
-
throw new Error(
|
|
6675
|
-
`Could not find parser implementation for ${loaderId} in ${implementationSpecifier}`
|
|
6676
|
-
);
|
|
6679
|
+
throw new Error(`Could not find parser implementation for ${loaderId} in ${implementationSpecifier}`);
|
|
6677
6680
|
}
|
|
6678
6681
|
var preparedLoaders = /* @__PURE__ */ new WeakSet();
|
|
6679
6682
|
var preparedDefaults = /* @__PURE__ */ new WeakMap();
|
|
6680
6683
|
var subloaderPreparations = /* @__PURE__ */ new WeakMap();
|
|
6681
6684
|
async function preloadLoaderDependencies(loader, options, url) {
|
|
6682
|
-
if (preparedLoaders.has(loader))
|
|
6685
|
+
if (preparedLoaders.has(loader))
|
|
6686
|
+
return await getLoaderImplementation(loader, options, url);
|
|
6683
6687
|
validateSubloaderGraph(loader, options);
|
|
6684
6688
|
return await prepareLoaderDependencies(loader, options, url);
|
|
6685
6689
|
}
|
|
6686
6690
|
async function prepareLoaderDependencies(loader, options, url) {
|
|
6687
6691
|
if (!options) {
|
|
6688
6692
|
const cached = subloaderPreparations.get(loader);
|
|
6689
|
-
if (cached)
|
|
6693
|
+
if (cached)
|
|
6694
|
+
return await cached;
|
|
6690
6695
|
}
|
|
6691
6696
|
const preparation = bindSubloaders(loader, options, url);
|
|
6692
6697
|
if (!options) {
|
|
@@ -6694,25 +6699,22 @@ var __exports__ = (() => {
|
|
|
6694
6699
|
void preparation.catch(() => subloaderPreparations.delete(loader));
|
|
6695
6700
|
}
|
|
6696
6701
|
const prepared = await preparation;
|
|
6697
|
-
if (!options)
|
|
6702
|
+
if (!options)
|
|
6703
|
+
preparedDefaults.set(loader, prepared);
|
|
6698
6704
|
return prepared;
|
|
6699
6705
|
}
|
|
6700
6706
|
function getSubloaders(loader, options) {
|
|
6701
6707
|
const overrides = options?.core?.subloaders || {};
|
|
6702
|
-
return Object.fromEntries(
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
])
|
|
6707
|
-
);
|
|
6708
|
+
return Object.fromEntries(Object.entries(loader.subloaders || {}).map(([name, dependency]) => [
|
|
6709
|
+
name,
|
|
6710
|
+
Object.hasOwn(overrides, name) ? overrides[name] : dependency
|
|
6711
|
+
]));
|
|
6708
6712
|
}
|
|
6709
6713
|
function validateSubloaderGraph(loader, options) {
|
|
6710
6714
|
visitLoader(loader, []);
|
|
6711
6715
|
function visitLoader(currentLoader, ancestors) {
|
|
6712
6716
|
if (ancestors.includes(currentLoader)) {
|
|
6713
|
-
throw new Error(
|
|
6714
|
-
`Subloader cycle: ${[...ancestors, currentLoader].map((value) => value.id).join(" -> ")}`
|
|
6715
|
-
);
|
|
6717
|
+
throw new Error(`Subloader cycle: ${[...ancestors, currentLoader].map((value) => value.id).join(" -> ")}`);
|
|
6716
6718
|
}
|
|
6717
6719
|
for (const dependency of Object.values(getSubloaders(currentLoader, options))) {
|
|
6718
6720
|
visitLoader(dependency, [...ancestors, currentLoader]);
|
|
@@ -6722,17 +6724,10 @@ var __exports__ = (() => {
|
|
|
6722
6724
|
async function bindSubloaders(loader, options, url) {
|
|
6723
6725
|
const [implementation, entries] = await Promise.all([
|
|
6724
6726
|
getLoaderImplementation(loader, options, url),
|
|
6725
|
-
Promise.all(
|
|
6726
|
-
Object.entries(getSubloaders(loader, options)).map(
|
|
6727
|
-
async ([name, dependency]) => [name, await prepareLoaderDependencies(dependency, options, url)]
|
|
6728
|
-
)
|
|
6729
|
-
)
|
|
6727
|
+
Promise.all(Object.entries(getSubloaders(loader, options)).map(async ([name, dependency]) => [name, await prepareLoaderDependencies(dependency, options, url)]))
|
|
6730
6728
|
]);
|
|
6731
6729
|
const subloaders = Object.fromEntries(entries);
|
|
6732
|
-
const defaultOptions = mergeOptions(
|
|
6733
|
-
implementation.options,
|
|
6734
|
-
options || {}
|
|
6735
|
-
);
|
|
6730
|
+
const defaultOptions = mergeOptions(implementation.options, options || {});
|
|
6736
6731
|
defaultOptions.core = { ...defaultOptions.core, worker: false };
|
|
6737
6732
|
const prepared = { ...implementation, options: defaultOptions, subloaders };
|
|
6738
6733
|
delete prepared.preload;
|
|
@@ -6753,20 +6748,15 @@ var __exports__ = (() => {
|
|
|
6753
6748
|
if (typeof parser === "function") {
|
|
6754
6749
|
prepared[method] = (data, parseOptions, context) => {
|
|
6755
6750
|
const forwardedOptions = mergeOptions(options, parseOptions || {});
|
|
6756
|
-
return parser.call(
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
...forwardedOptions.core,
|
|
6763
|
-
subloaders: options?.core?.subloaders || parseOptions?.core?.subloaders,
|
|
6764
|
-
worker: false
|
|
6765
|
-
},
|
|
6766
|
-
[loader.id]: { ...forwardedOptions[loader.id], subloaders }
|
|
6751
|
+
return parser.call(implementation, data, {
|
|
6752
|
+
...forwardedOptions,
|
|
6753
|
+
core: {
|
|
6754
|
+
...forwardedOptions.core,
|
|
6755
|
+
subloaders: options?.core?.subloaders || parseOptions?.core?.subloaders,
|
|
6756
|
+
worker: false
|
|
6767
6757
|
},
|
|
6768
|
-
|
|
6769
|
-
);
|
|
6758
|
+
[loader.id]: { ...forwardedOptions[loader.id], subloaders }
|
|
6759
|
+
}, context);
|
|
6770
6760
|
};
|
|
6771
6761
|
}
|
|
6772
6762
|
}
|
|
@@ -6774,7 +6764,7 @@ var __exports__ = (() => {
|
|
|
6774
6764
|
return prepared;
|
|
6775
6765
|
}
|
|
6776
6766
|
|
|
6777
|
-
//
|
|
6767
|
+
// dist/lib/api/parse-file.js
|
|
6778
6768
|
async function parseFile(file, loaders, options, context) {
|
|
6779
6769
|
if (loaders && !Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
6780
6770
|
context = void 0;
|
|
@@ -6792,11 +6782,7 @@ var __exports__ = (() => {
|
|
|
6792
6782
|
}
|
|
6793
6783
|
const normalizedOptions = normalizeOptions(options, loader, candidateLoaders, url);
|
|
6794
6784
|
const authenticationLoader = !loader.getAuthentications && normalizedOptions.core?.credentials?.length ? await getLoaderImplementation(loader, normalizedOptions, url || context?.url) : loader;
|
|
6795
|
-
const strictOptions = await resolveLoaderAuthenticationOptions(
|
|
6796
|
-
authenticationLoader,
|
|
6797
|
-
url,
|
|
6798
|
-
normalizedOptions
|
|
6799
|
-
);
|
|
6785
|
+
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url, normalizedOptions);
|
|
6800
6786
|
context = getLoaderContext(
|
|
6801
6787
|
// @ts-expect-error candidateLoaders may be a single forced loader
|
|
6802
6788
|
{ url, _parse: parse, loaders: candidateLoaders },
|
|
@@ -6830,7 +6816,7 @@ var __exports__ = (() => {
|
|
|
6830
6816
|
throw new Error(`${loader.id} loader - no file parser found`);
|
|
6831
6817
|
}
|
|
6832
6818
|
|
|
6833
|
-
//
|
|
6819
|
+
// dist/lib/api/parse-sync.js
|
|
6834
6820
|
function parseSync(data, loaders, options, context) {
|
|
6835
6821
|
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
6836
6822
|
context = void 0;
|
|
@@ -6849,18 +6835,9 @@ var __exports__ = (() => {
|
|
|
6849
6835
|
const parse2 = () => {
|
|
6850
6836
|
throw new Error("parseSync called parse (which is async");
|
|
6851
6837
|
};
|
|
6852
|
-
context = getLoaderContext(
|
|
6853
|
-
{ url, _parseSync: parse2, _parse: parse2, loaders },
|
|
6854
|
-
strictOptions,
|
|
6855
|
-
context || null
|
|
6856
|
-
);
|
|
6838
|
+
context = getLoaderContext({ url, _parseSync: parse2, _parse: parse2, loaders }, strictOptions, context || null);
|
|
6857
6839
|
const loaderWithParser = getLoaderImplementationSync(loader);
|
|
6858
|
-
return parseWithLoaderSync(
|
|
6859
|
-
loaderWithParser || loader,
|
|
6860
|
-
data,
|
|
6861
|
-
strictOptions,
|
|
6862
|
-
context
|
|
6863
|
-
);
|
|
6840
|
+
return parseWithLoaderSync(loaderWithParser || loader, data, strictOptions, context);
|
|
6864
6841
|
}
|
|
6865
6842
|
function parseWithLoaderSync(loader, data, options, context) {
|
|
6866
6843
|
data = getArrayBufferOrStringFromDataSync(data, loader, options);
|
|
@@ -6871,21 +6848,15 @@ var __exports__ = (() => {
|
|
|
6871
6848
|
return loader.parseSync(data, options, context);
|
|
6872
6849
|
}
|
|
6873
6850
|
if (loader.preload) {
|
|
6874
|
-
throw new Error(
|
|
6875
|
-
`${loader.name} loader: 'parseSync' requires a parser-bearing loader. Import the loader implementation directly, or call preload(loader) before parseSync(). ${context.url || ""}`
|
|
6876
|
-
);
|
|
6851
|
+
throw new Error(`${loader.name} loader: 'parseSync' requires a parser-bearing loader. Import the loader implementation directly, or call preload(loader) before parseSync(). ${context.url || ""}`);
|
|
6877
6852
|
}
|
|
6878
6853
|
if (loader.createDataSourceSync) {
|
|
6879
|
-
throw new Error(
|
|
6880
|
-
`${loader.id} has no synchronous parser. Use createDataSource() to open a source.`
|
|
6881
|
-
);
|
|
6854
|
+
throw new Error(`${loader.id} has no synchronous parser. Use createDataSource() to open a source.`);
|
|
6882
6855
|
}
|
|
6883
|
-
throw new Error(
|
|
6884
|
-
`${loader.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${context.url || ""}`
|
|
6885
|
-
);
|
|
6856
|
+
throw new Error(`${loader.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${context.url || ""}`);
|
|
6886
6857
|
}
|
|
6887
6858
|
|
|
6888
|
-
//
|
|
6859
|
+
// dist/lib/api/parse-in-batches.js
|
|
6889
6860
|
async function parseInBatches(data, loaders, options, context) {
|
|
6890
6861
|
const loaderArray = Array.isArray(loaders) ? loaders : void 0;
|
|
6891
6862
|
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
@@ -6904,25 +6875,11 @@ var __exports__ = (() => {
|
|
|
6904
6875
|
}
|
|
6905
6876
|
const normalizedOptions = normalizeOptions(options, loader, loaderArray, url);
|
|
6906
6877
|
const authenticationLoader = !loader.getAuthentications && normalizedOptions.core?.credentials?.length ? await getLoaderImplementation(loader, normalizedOptions, url || context?.url) : loader;
|
|
6907
|
-
const strictOptions = await resolveLoaderAuthenticationOptions(
|
|
6908
|
-
authenticationLoader,
|
|
6909
|
-
url || "",
|
|
6910
|
-
normalizedOptions
|
|
6911
|
-
);
|
|
6878
|
+
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url || "", normalizedOptions);
|
|
6912
6879
|
const nativeArrow = usesNativeArrowBatches(loader, strictOptions);
|
|
6913
|
-
context = getLoaderContext(
|
|
6914
|
-
{ url, _parseInBatches: parseInBatches, _parse: parse, loaders: loaderArray },
|
|
6915
|
-
strictOptions,
|
|
6916
|
-
context || null
|
|
6917
|
-
);
|
|
6880
|
+
context = getLoaderContext({ url, _parseInBatches: parseInBatches, _parse: parse, loaders: loaderArray }, strictOptions, context || null);
|
|
6918
6881
|
const loaderWithParser = await getLoaderImplementation(loader, strictOptions, context.url);
|
|
6919
|
-
const batches = await parseWithLoaderInBatches(
|
|
6920
|
-
loader,
|
|
6921
|
-
loaderWithParser,
|
|
6922
|
-
data,
|
|
6923
|
-
strictOptions,
|
|
6924
|
-
context
|
|
6925
|
-
);
|
|
6882
|
+
const batches = await parseWithLoaderInBatches(loader, loaderWithParser, data, strictOptions, context);
|
|
6926
6883
|
return nativeArrow ? normalizeNativeArrowBatches(batches) : batches;
|
|
6927
6884
|
}
|
|
6928
6885
|
async function parseWithLoaderInBatches(originalLoader, loader, data, options, context) {
|
|
@@ -6933,12 +6890,7 @@ var __exports__ = (() => {
|
|
|
6933
6890
|
}
|
|
6934
6891
|
const parserOptions = batchMaxRowsPerSecond ? { ...options, core: { ...options.core, batchMaxRowsPerSecond: 0 } } : options;
|
|
6935
6892
|
const output = loader.parseInBatches ? loader.prepareParseBatchOutput?.(parserOptions) : null;
|
|
6936
|
-
const decoded = await parseToOutputIterator(
|
|
6937
|
-
loader,
|
|
6938
|
-
data,
|
|
6939
|
-
output?.options ?? parserOptions,
|
|
6940
|
-
context
|
|
6941
|
-
);
|
|
6893
|
+
const decoded = await parseToOutputIterator(loader, data, output?.options ?? parserOptions, context);
|
|
6942
6894
|
const batches = output ? convertOutputBatches(decoded, output.convert) : decoded;
|
|
6943
6895
|
const outputIterator = batchMaxRowsPerSecond ? paceBatchIterator(batches, {
|
|
6944
6896
|
batchMaxRowsPerSecond,
|
|
@@ -6972,10 +6924,7 @@ var __exports__ = (() => {
|
|
|
6972
6924
|
}
|
|
6973
6925
|
async function parseToOutputIterator(loader, data, options, context) {
|
|
6974
6926
|
const inputIterator = await getAsyncIterableFromData(data, options);
|
|
6975
|
-
const transformedIterator = await applyInputTransforms(
|
|
6976
|
-
inputIterator,
|
|
6977
|
-
options?.core?.transforms || []
|
|
6978
|
-
);
|
|
6927
|
+
const transformedIterator = await applyInputTransforms(inputIterator, options?.core?.transforms || []);
|
|
6979
6928
|
if (loader.parseInBatches) {
|
|
6980
6929
|
if (canParseWithWorkerInBatches(loader, options)) {
|
|
6981
6930
|
return parseWithWorkerInBatches(loader, transformedIterator, options, context, parse);
|
|
@@ -7049,18 +6998,22 @@ var __exports__ = (() => {
|
|
|
7049
6998
|
return iteratorChain;
|
|
7050
6999
|
}
|
|
7051
7000
|
function getBatchRowCount(batch, module) {
|
|
7052
|
-
if (!batch || typeof batch !== "object")
|
|
7053
|
-
|
|
7001
|
+
if (!batch || typeof batch !== "object")
|
|
7002
|
+
return void 0;
|
|
7003
|
+
if (module === "geospatial" && Array.isArray(batch))
|
|
7004
|
+
return batch.length;
|
|
7054
7005
|
const result = batch;
|
|
7055
7006
|
if (module === "traces" && result.table !== void 0 && result.table !== "spans" && result.table !== "slices") {
|
|
7056
7007
|
return void 0;
|
|
7057
7008
|
}
|
|
7058
|
-
if (result.batchType !== void 0 && result.batchType !== "data")
|
|
7059
|
-
|
|
7009
|
+
if (result.batchType !== void 0 && result.batchType !== "data")
|
|
7010
|
+
return void 0;
|
|
7011
|
+
if (result.shape === "unknown")
|
|
7012
|
+
return void 0;
|
|
7060
7013
|
return result.data?.numRows ?? result.numRows ?? result.header?.vertexCount ?? result.features?.length ?? result.length;
|
|
7061
7014
|
}
|
|
7062
7015
|
|
|
7063
|
-
//
|
|
7016
|
+
// dist/lib/api/load.js
|
|
7064
7017
|
async function load(url, loaders, options, context) {
|
|
7065
7018
|
let resolvedLoaders;
|
|
7066
7019
|
let resolvedOptions;
|
|
@@ -7080,11 +7033,7 @@ var __exports__ = (() => {
|
|
|
7080
7033
|
core: { ...resolvedOptions?.core, nothrow: true }
|
|
7081
7034
|
});
|
|
7082
7035
|
const canFetchBeforePreload = typeof url === "string" && selectedLoader?.fetchBeforePreload;
|
|
7083
|
-
const loaderImplementation = selectedLoader && (typeof url === "string" || selectedLoader.createDataSourceSync) ? getLoaderImplementation(
|
|
7084
|
-
selectedLoader,
|
|
7085
|
-
resolvedOptions,
|
|
7086
|
-
typeof url === "string" ? url : void 0
|
|
7087
|
-
) : null;
|
|
7036
|
+
const loaderImplementation = selectedLoader && (typeof url === "string" || selectedLoader.createDataSourceSync) ? getLoaderImplementation(selectedLoader, resolvedOptions, typeof url === "string" ? url : void 0) : null;
|
|
7088
7037
|
if (canFetchBeforePreload) {
|
|
7089
7038
|
const loadOptions = resolvedOptions;
|
|
7090
7039
|
const controller = new AbortController();
|
|
@@ -7108,16 +7057,10 @@ var __exports__ = (() => {
|
|
|
7108
7057
|
}
|
|
7109
7058
|
const implementation = await loaderImplementation;
|
|
7110
7059
|
if (selectedLoader && implementation?.createDataSourceSync && !isLoaderWithParser(implementation)) {
|
|
7111
|
-
throw new Error(
|
|
7112
|
-
`${selectedLoader.id} creates sources. Use createDataSource() instead of load().`
|
|
7113
|
-
);
|
|
7060
|
+
throw new Error(`${selectedLoader.id} creates sources. Use createDataSource() instead of load().`);
|
|
7114
7061
|
}
|
|
7115
7062
|
if (!fetchedResponse && selectedLoader && implementation && typeof url === "string") {
|
|
7116
|
-
resolvedOptions = await resolveLoaderAuthenticationOptions(
|
|
7117
|
-
selectedLoader.getAuthentications ? selectedLoader : implementation,
|
|
7118
|
-
url,
|
|
7119
|
-
resolvedOptions || {}
|
|
7120
|
-
);
|
|
7063
|
+
resolvedOptions = await resolveLoaderAuthenticationOptions(selectedLoader.getAuthentications ? selectedLoader : implementation, url, resolvedOptions || {});
|
|
7121
7064
|
const { parseUrl } = implementation;
|
|
7122
7065
|
if (parseUrl) {
|
|
7123
7066
|
const requestUrl = applySearchParamsToUrl(url, resolvedOptions);
|
|
@@ -7126,7 +7069,8 @@ var __exports__ = (() => {
|
|
|
7126
7069
|
}
|
|
7127
7070
|
}
|
|
7128
7071
|
}
|
|
7129
|
-
if (resolvedOptions)
|
|
7072
|
+
if (resolvedOptions)
|
|
7073
|
+
resolvedOptions = resolveAuthenticationOptions(resolvedOptions);
|
|
7130
7074
|
const fetch2 = getFetchFunction(resolvedOptions);
|
|
7131
7075
|
let data = url;
|
|
7132
7076
|
if (typeof url === "string") {
|
|
@@ -7149,7 +7093,7 @@ var __exports__ = (() => {
|
|
|
7149
7093
|
return Array.isArray(resolvedLoaders) ? await parse(data, resolvedLoaders, resolvedOptions, context) : await parse(data, resolvedLoaders, resolvedOptions, context);
|
|
7150
7094
|
}
|
|
7151
7095
|
|
|
7152
|
-
//
|
|
7096
|
+
// dist/lib/api/load-in-batches.js
|
|
7153
7097
|
function loadInBatches(files, loaders, options, context) {
|
|
7154
7098
|
let loadersArray;
|
|
7155
7099
|
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
@@ -7181,7 +7125,7 @@ var __exports__ = (() => {
|
|
|
7181
7125
|
return Array.isArray(loaders) ? await parseInBatches(file, loaders, options) : await parseInBatches(file, loaders, options);
|
|
7182
7126
|
}
|
|
7183
7127
|
|
|
7184
|
-
//
|
|
7128
|
+
// dist/lib/api/core-api.js
|
|
7185
7129
|
var coreApi = Object.freeze({
|
|
7186
7130
|
fetchFile,
|
|
7187
7131
|
parse,
|
|
@@ -7192,7 +7136,7 @@ var __exports__ = (() => {
|
|
|
7192
7136
|
loadInBatches
|
|
7193
7137
|
});
|
|
7194
7138
|
|
|
7195
|
-
//
|
|
7139
|
+
// dist/lib/loader-utils/loader-context.js
|
|
7196
7140
|
function getLoaderContext(context, options, parentContext) {
|
|
7197
7141
|
if (parentContext) {
|
|
7198
7142
|
return {
|
|
@@ -7238,7 +7182,7 @@ var __exports__ = (() => {
|
|
|
7238
7182
|
return candidateLoaders && candidateLoaders.length ? candidateLoaders : void 0;
|
|
7239
7183
|
}
|
|
7240
7184
|
|
|
7241
|
-
//
|
|
7185
|
+
// dist/lib/api/parse.js
|
|
7242
7186
|
async function parse(data, loaders, options, context) {
|
|
7243
7187
|
if (loaders && !Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
7244
7188
|
context = void 0;
|
|
@@ -7258,11 +7202,7 @@ var __exports__ = (() => {
|
|
|
7258
7202
|
}
|
|
7259
7203
|
const normalizedOptions = normalizeOptions(options, loader, candidateLoaders, url);
|
|
7260
7204
|
const authenticationLoader = !loader.getAuthentications && normalizedOptions.core?.credentials?.length ? await getLoaderImplementation(loader, normalizedOptions, url || context?.url) : loader;
|
|
7261
|
-
const strictOptions = await resolveLoaderAuthenticationOptions(
|
|
7262
|
-
authenticationLoader,
|
|
7263
|
-
url || "",
|
|
7264
|
-
normalizedOptions
|
|
7265
|
-
);
|
|
7205
|
+
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url || "", normalizedOptions);
|
|
7266
7206
|
context = getLoaderContext(
|
|
7267
7207
|
// @ts-expect-error
|
|
7268
7208
|
{ url, _parse: parse, loaders: candidateLoaders },
|
|
@@ -7309,9 +7249,7 @@ var __exports__ = (() => {
|
|
|
7309
7249
|
return await loader.parse(data, options, context);
|
|
7310
7250
|
}
|
|
7311
7251
|
if (loader.parseSync) {
|
|
7312
|
-
throw new Error(
|
|
7313
|
-
`${loader.name} loader: 'parse' not available on parser-bearing sync loader. Add an async 'parse' function to this loader, or call preload(loader) before parseSync(). ${context.url || ""}`
|
|
7314
|
-
);
|
|
7252
|
+
throw new Error(`${loader.name} loader: 'parse' not available on parser-bearing sync loader. Add an async 'parse' function to this loader, or call preload(loader) before parseSync(). ${context.url || ""}`);
|
|
7315
7253
|
}
|
|
7316
7254
|
if (loader.createDataSourceSync) {
|
|
7317
7255
|
throw new Error(`${loader.id} creates sources. Use createDataSource() to open a source.`);
|
|
@@ -7319,7 +7257,7 @@ var __exports__ = (() => {
|
|
|
7319
7257
|
throw new Error(`${loader.id} loader - no parser found and worker is disabled`);
|
|
7320
7258
|
}
|
|
7321
7259
|
|
|
7322
|
-
//
|
|
7260
|
+
// dist/lib/api/preload.js
|
|
7323
7261
|
async function preload(loader, options, url) {
|
|
7324
7262
|
return loader.subloaders ? await preloadLoaderDependencies(loader, options, url) : await getLoaderImplementation(loader, options, url);
|
|
7325
7263
|
}
|
|
@@ -7327,8 +7265,9 @@ var __exports__ = (() => {
|
|
|
7327
7265
|
return getLoaderImplementationSync(loader);
|
|
7328
7266
|
}
|
|
7329
7267
|
|
|
7330
|
-
//
|
|
7331
|
-
async function encodeTable(data,
|
|
7268
|
+
// dist/lib/api/encode-table.js
|
|
7269
|
+
async function encodeTable(data, writerDefinition, options) {
|
|
7270
|
+
const writer = writerDefinition.preload ? await writerDefinition.preload() : writerDefinition;
|
|
7332
7271
|
if (writer.encode) {
|
|
7333
7272
|
return await writer.encode(data, options);
|
|
7334
7273
|
}
|
|
@@ -7346,7 +7285,8 @@ var __exports__ = (() => {
|
|
|
7346
7285
|
}
|
|
7347
7286
|
throw new Error("Writer could not encode data");
|
|
7348
7287
|
}
|
|
7349
|
-
async function encodeTableAsText(data,
|
|
7288
|
+
async function encodeTableAsText(data, writerDefinition, options) {
|
|
7289
|
+
const writer = writerDefinition.preload ? await writerDefinition.preload() : writerDefinition;
|
|
7350
7290
|
if (writer.text && writer.encodeText) {
|
|
7351
7291
|
return await writer.encodeText(data, options);
|
|
7352
7292
|
}
|
|
@@ -7356,7 +7296,18 @@ var __exports__ = (() => {
|
|
|
7356
7296
|
}
|
|
7357
7297
|
throw new Error(`Writer ${writer.name} could not encode data as text`);
|
|
7358
7298
|
}
|
|
7359
|
-
function encodeTableInBatches(data,
|
|
7299
|
+
function encodeTableInBatches(data, writerDefinition, options) {
|
|
7300
|
+
const writer = writerDefinition;
|
|
7301
|
+
if (!writer.encodeInBatches && writer.preload) {
|
|
7302
|
+
const preload2 = writer.preload.bind(writer);
|
|
7303
|
+
return (async function* () {
|
|
7304
|
+
const implementation = await preload2();
|
|
7305
|
+
yield* encodeWriterTableInBatches(data, implementation, options);
|
|
7306
|
+
})();
|
|
7307
|
+
}
|
|
7308
|
+
return encodeWriterTableInBatches(data, writer, options);
|
|
7309
|
+
}
|
|
7310
|
+
function encodeWriterTableInBatches(data, writer, options) {
|
|
7360
7311
|
if (writer.encodeInBatches) {
|
|
7361
7312
|
const dataIterator = getIterator(data);
|
|
7362
7313
|
return writer.encodeInBatches(dataIterator, options);
|
|
@@ -7368,8 +7319,9 @@ var __exports__ = (() => {
|
|
|
7368
7319
|
return dataIterator;
|
|
7369
7320
|
}
|
|
7370
7321
|
|
|
7371
|
-
//
|
|
7372
|
-
async function encode(data,
|
|
7322
|
+
// dist/lib/api/encode.js
|
|
7323
|
+
async function encode(data, writerDefinition, options_) {
|
|
7324
|
+
const writer = writerDefinition.preload ? await writerDefinition.preload() : writerDefinition;
|
|
7373
7325
|
const globalOptions = getGlobalLoaderOptions();
|
|
7374
7326
|
const options = { ...globalOptions, ...options_ };
|
|
7375
7327
|
if (writer.encodeURLtoURL) {
|
|
@@ -7378,6 +7330,9 @@ var __exports__ = (() => {
|
|
|
7378
7330
|
if (canEncodeWithWorker(writer, options)) {
|
|
7379
7331
|
return await processOnWorker2(writer, data, options);
|
|
7380
7332
|
}
|
|
7333
|
+
if (!writer.encode) {
|
|
7334
|
+
throw new Error(`Writer ${writer.name} could not encode data`);
|
|
7335
|
+
}
|
|
7381
7336
|
return await writer.encode(data, options);
|
|
7382
7337
|
}
|
|
7383
7338
|
function encodeSync(data, writer, options) {
|
|
@@ -7389,14 +7344,15 @@ var __exports__ = (() => {
|
|
|
7389
7344
|
}
|
|
7390
7345
|
throw new Error(`Writer ${writer.name} could not synchronously encode data`);
|
|
7391
7346
|
}
|
|
7392
|
-
async function encodeText(data,
|
|
7347
|
+
async function encodeText(data, writerDefinition, options) {
|
|
7348
|
+
const writer = writerDefinition.preload ? await writerDefinition.preload() : writerDefinition;
|
|
7393
7349
|
if (writer.encodeText) {
|
|
7394
7350
|
return await writer.encodeText(data, options);
|
|
7395
7351
|
}
|
|
7396
7352
|
if (writer.encodeTextSync) {
|
|
7397
7353
|
return writer.encodeTextSync(data, options);
|
|
7398
7354
|
}
|
|
7399
|
-
if (writer.text) {
|
|
7355
|
+
if (writer.text && writer.encode) {
|
|
7400
7356
|
const arrayBuffer = await writer.encode(data, options);
|
|
7401
7357
|
return new TextDecoder().decode(arrayBuffer);
|
|
7402
7358
|
}
|
|
@@ -7412,7 +7368,18 @@ var __exports__ = (() => {
|
|
|
7412
7368
|
}
|
|
7413
7369
|
throw new Error(`Writer ${writer.name} could not encode data as text`);
|
|
7414
7370
|
}
|
|
7415
|
-
function encodeInBatches(data,
|
|
7371
|
+
function encodeInBatches(data, writerDefinition, options) {
|
|
7372
|
+
const writer = writerDefinition;
|
|
7373
|
+
if (!writer.encodeInBatches && writer.preload) {
|
|
7374
|
+
const preload2 = writer.preload.bind(writer);
|
|
7375
|
+
return (async function* () {
|
|
7376
|
+
const implementation = await preload2();
|
|
7377
|
+
yield* encodeWriterInBatches(data, implementation, options);
|
|
7378
|
+
})();
|
|
7379
|
+
}
|
|
7380
|
+
return encodeWriterInBatches(data, writer, options);
|
|
7381
|
+
}
|
|
7382
|
+
function encodeWriterInBatches(data, writer, options) {
|
|
7416
7383
|
if (writer.encodeInBatches) {
|
|
7417
7384
|
let dataIterator;
|
|
7418
7385
|
if (data && typeof data === "object") {
|
|
@@ -7426,10 +7393,14 @@ var __exports__ = (() => {
|
|
|
7426
7393
|
}
|
|
7427
7394
|
throw new Error(`Writer ${writer.name} could not encode in batches`);
|
|
7428
7395
|
}
|
|
7429
|
-
async function encodeURLtoURL(inputUrl, outputUrl,
|
|
7396
|
+
async function encodeURLtoURL(inputUrl, outputUrl, writerDefinition, options) {
|
|
7430
7397
|
inputUrl = resolvePath(inputUrl);
|
|
7431
7398
|
outputUrl = resolvePath(outputUrl);
|
|
7432
|
-
if (isBrowser
|
|
7399
|
+
if (isBrowser) {
|
|
7400
|
+
throw new Error();
|
|
7401
|
+
}
|
|
7402
|
+
const writer = writerDefinition.encodeURLtoURL ? writerDefinition : await writerDefinition.preload?.() ?? writerDefinition;
|
|
7403
|
+
if (!writer.encodeURLtoURL) {
|
|
7433
7404
|
throw new Error();
|
|
7434
7405
|
}
|
|
7435
7406
|
const outputFilename = await writer.encodeURLtoURL(inputUrl, outputUrl, options);
|
|
@@ -7455,48 +7426,30 @@ var __exports__ = (() => {
|
|
|
7455
7426
|
return `/tmp/${filename2}`;
|
|
7456
7427
|
}
|
|
7457
7428
|
|
|
7458
|
-
//
|
|
7429
|
+
// dist/lib/api/create-data-source.js
|
|
7459
7430
|
async function createDataSource(data, loaders, options = {}) {
|
|
7460
7431
|
options.signal?.throwIfAborted();
|
|
7461
7432
|
const candidates = getCandidates(loaders, options);
|
|
7462
|
-
const loader = candidates.length === 1 ? candidates[0] : await selectLoader(
|
|
7463
|
-
data,
|
|
7464
|
-
candidates,
|
|
7465
|
-
getSelectionOptions(options),
|
|
7466
|
-
void 0,
|
|
7467
|
-
"source"
|
|
7468
|
-
);
|
|
7433
|
+
const loader = candidates.length === 1 ? candidates[0] : await selectLoader(data, candidates, getSelectionOptions(options), void 0, "source");
|
|
7469
7434
|
if (!loader) {
|
|
7470
7435
|
throw new Error("No explicit source loader matches the input");
|
|
7471
7436
|
}
|
|
7472
7437
|
const url = typeof data === "string" ? data : "";
|
|
7473
7438
|
const implementation = await preload(loader, options, url);
|
|
7474
7439
|
options.signal?.throwIfAborted();
|
|
7475
|
-
const authenticatedOptions = await resolveLoaderAuthenticationOptions(
|
|
7476
|
-
loader.getAuthentications ? loader : implementation,
|
|
7477
|
-
url,
|
|
7478
|
-
options
|
|
7479
|
-
);
|
|
7440
|
+
const authenticatedOptions = await resolveLoaderAuthenticationOptions(loader.getAuthentications ? loader : implementation, url, options);
|
|
7480
7441
|
options.signal?.throwIfAborted();
|
|
7481
7442
|
return constructSource(implementation, data, authenticatedOptions);
|
|
7482
7443
|
}
|
|
7483
7444
|
function createDataSourceSync(data, loaders, options = {}) {
|
|
7484
7445
|
const candidates = getCandidates(loaders, options);
|
|
7485
|
-
const loader = candidates.length === 1 ? candidates[0] : selectLoaderSync(
|
|
7486
|
-
data,
|
|
7487
|
-
candidates,
|
|
7488
|
-
getSelectionOptions(options),
|
|
7489
|
-
void 0,
|
|
7490
|
-
"source"
|
|
7491
|
-
);
|
|
7446
|
+
const loader = candidates.length === 1 ? candidates[0] : selectLoaderSync(data, candidates, getSelectionOptions(options), void 0, "source");
|
|
7492
7447
|
if (!loader) {
|
|
7493
7448
|
throw new Error("No explicit source loader matches the input");
|
|
7494
7449
|
}
|
|
7495
7450
|
const implementation = getLoaderImplementationSync(loader, options);
|
|
7496
7451
|
if (!implementation) {
|
|
7497
|
-
throw new Error(
|
|
7498
|
-
`${loader.id} has no synchronous source factory available. Call preload() first.`
|
|
7499
|
-
);
|
|
7452
|
+
throw new Error(`${loader.id} has no synchronous source factory available. Call preload() first.`);
|
|
7500
7453
|
}
|
|
7501
7454
|
const authenticationLoader = loader.getAuthentications ? loader : implementation;
|
|
7502
7455
|
const contributions = options.core?.credentials?.length ? authenticationLoader.getAuthentications?.(typeof data === "string" ? data : "", options) : void 0;
|
|
@@ -7505,15 +7458,13 @@ var __exports__ = (() => {
|
|
|
7505
7458
|
});
|
|
7506
7459
|
throw new Error("Use createDataSource() with an asynchronous getAuthentications() hook.");
|
|
7507
7460
|
}
|
|
7508
|
-
const authenticatedOptions = resolveAuthenticationOptions(
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
core
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
} : options
|
|
7516
|
-
);
|
|
7461
|
+
const authenticatedOptions = resolveAuthenticationOptions(contributions?.length ? {
|
|
7462
|
+
...options,
|
|
7463
|
+
core: {
|
|
7464
|
+
...options.core,
|
|
7465
|
+
authentications: [...options.core?.authentications || [], ...contributions]
|
|
7466
|
+
}
|
|
7467
|
+
} : options);
|
|
7517
7468
|
return constructSource(implementation, data, authenticatedOptions);
|
|
7518
7469
|
}
|
|
7519
7470
|
function getCandidates(loaders, options) {
|
|
@@ -7528,23 +7479,15 @@ var __exports__ = (() => {
|
|
|
7528
7479
|
if (loader.createDataSourceSync) {
|
|
7529
7480
|
return loader.createDataSourceSync(data, options, coreApi);
|
|
7530
7481
|
}
|
|
7531
|
-
throw new Error(
|
|
7532
|
-
`${loader.id} has no synchronous source factory. Use createDataSource() to preload the loader.`
|
|
7533
|
-
);
|
|
7482
|
+
throw new Error(`${loader.id} has no synchronous source factory. Use createDataSource() to preload the loader.`);
|
|
7534
7483
|
}
|
|
7535
7484
|
|
|
7536
|
-
//
|
|
7485
|
+
// dist/lib/api/select-source.js
|
|
7537
7486
|
function selectSource(url, sources, options) {
|
|
7538
7487
|
const type = options?.type || "auto";
|
|
7539
7488
|
let selectedSource = null;
|
|
7540
7489
|
if (type === "auto") {
|
|
7541
|
-
selectedSource = selectLoaderSync(
|
|
7542
|
-
url,
|
|
7543
|
-
sources,
|
|
7544
|
-
{ core: { nothrow: true } },
|
|
7545
|
-
void 0,
|
|
7546
|
-
"source"
|
|
7547
|
-
);
|
|
7490
|
+
selectedSource = selectLoaderSync(url, sources, { core: { nothrow: true } }, void 0, "source");
|
|
7548
7491
|
} else {
|
|
7549
7492
|
selectedSource = getSourceOfType(type, sources);
|
|
7550
7493
|
}
|
|
@@ -7562,7 +7505,7 @@ var __exports__ = (() => {
|
|
|
7562
7505
|
return null;
|
|
7563
7506
|
}
|
|
7564
7507
|
|
|
7565
|
-
//
|
|
7508
|
+
// dist/iterators/make-stream/make-stream.js
|
|
7566
7509
|
function makeStream(source, options) {
|
|
7567
7510
|
if (globalThis.loaders.makeNodeStream) {
|
|
7568
7511
|
return globalThis.loaders.makeNodeStream(source, options);
|
|
@@ -7600,34 +7543,7 @@ var __exports__ = (() => {
|
|
|
7600
7543
|
);
|
|
7601
7544
|
}
|
|
7602
7545
|
|
|
7603
|
-
//
|
|
7604
|
-
var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
7605
|
-
var NullLoader = {
|
|
7606
|
-
dataType: null,
|
|
7607
|
-
batchType: null,
|
|
7608
|
-
name: "Null loader",
|
|
7609
|
-
id: "null",
|
|
7610
|
-
module: "core",
|
|
7611
|
-
version: VERSION6,
|
|
7612
|
-
mimeTypes: ["application/x.empty"],
|
|
7613
|
-
extensions: ["null"],
|
|
7614
|
-
parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options || {}, context),
|
|
7615
|
-
parseSync: parseSync2,
|
|
7616
|
-
parseInBatches: async function* generator(asyncIterator, options, context) {
|
|
7617
|
-
for await (const batch of asyncIterator) {
|
|
7618
|
-
yield parseSync2(batch, options, context);
|
|
7619
|
-
}
|
|
7620
|
-
},
|
|
7621
|
-
tests: [() => false],
|
|
7622
|
-
options: {
|
|
7623
|
-
null: {}
|
|
7624
|
-
}
|
|
7625
|
-
};
|
|
7626
|
-
function parseSync2(arrayBuffer, options, context) {
|
|
7627
|
-
return null;
|
|
7628
|
-
}
|
|
7629
|
-
|
|
7630
|
-
// src/lib/progress/fetch-progress.ts
|
|
7546
|
+
// dist/lib/progress/fetch-progress.js
|
|
7631
7547
|
async function fetchProgress(response, onProgress, onDone = () => {
|
|
7632
7548
|
}, onError = () => {
|
|
7633
7549
|
}) {
|
|
@@ -7674,7 +7590,7 @@ var __exports__ = (() => {
|
|
|
7674
7590
|
}
|
|
7675
7591
|
}
|
|
7676
7592
|
|
|
7677
|
-
//
|
|
7593
|
+
// dist/lib/filesystems/browser-filesystem.js
|
|
7678
7594
|
var BrowserFileSystem = class {
|
|
7679
7595
|
_fetch;
|
|
7680
7596
|
files = {};
|
|
@@ -7782,6 +7698,9 @@ var __exports__ = (() => {
|
|
|
7782
7698
|
return file;
|
|
7783
7699
|
}
|
|
7784
7700
|
};
|
|
7701
|
+
|
|
7702
|
+
// src/index.ts
|
|
7703
|
+
init_null_loader();
|
|
7785
7704
|
return __toCommonJS(bundle_exports);
|
|
7786
7705
|
})();
|
|
7787
7706
|
return __exports__;
|