@loaders.gl/core 5.0.0-beta.7 → 5.0.0-rc.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/GEOARROW-README.md +6 -0
- package/SCAN-README.md +2 -2
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-features.cjs +4 -1
- package/dist/arrow-geometry/binary-features.cjs.map +2 -2
- package/dist/arrow-geometry/binary-features.d.ts.map +1 -1
- package/dist/arrow-geometry/binary-features.js +1 -1
- package/dist/arrow-geometry/binary-features.js.map +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.cjs.map +2 -2
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -6
- package/dist/arrow-geometry/feature-table.cjs.map +2 -2
- package/dist/arrow-geometry/feature-table.d.ts +6 -5
- package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-table.js +5 -9
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +295 -18
- package/dist/arrow-geometry/geojson-table.cjs.map +4 -4
- package/dist/arrow-geometry/geojson-table.d.ts +10 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +23 -13
- package/dist/arrow-geometry/geojson-table.js.map +1 -1
- package/dist/arrow-geometry/geometry-codecs.cjs +6 -6
- package/dist/arrow-geometry/geometry-codecs.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-codecs.js +1 -1
- package/dist/arrow-geometry/geometry-codecs.js.map +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.cjs +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.js +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.js.map +1 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs +3 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs.map +2 -2
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js +3 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.cjs +1 -5
- package/dist/arrow-geometry/wkb-arrow-utils.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts +7 -7
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.js +4 -8
- package/dist/arrow-geometry/wkb-arrow-utils.js.map +1 -1
- package/dist/arrow-geometry/wkb-builder.cjs +3 -3
- package/dist/arrow-geometry/wkb-builder.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-builder.d.ts +1 -1
- package/dist/arrow-geometry/wkb-builder.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-builder.js +1 -1
- package/dist/arrow-geometry/wkb-builder.js.map +1 -1
- package/dist/arrow-geometry/wkb-statistics.cjs +2 -2
- package/dist/arrow-geometry/wkb-statistics.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-statistics.js +1 -1
- package/dist/arrow-geometry/wkb-statistics.js.map +1 -1
- package/dist/arrow-worker-transport.cjs +59 -35
- package/dist/arrow-worker-transport.cjs.map +1 -1
- package/dist/arrow-worker-transport.d.ts +9 -7
- package/dist/arrow-worker-transport.d.ts.map +1 -1
- package/dist/arrow-worker-transport.js +59 -42
- package/dist/arrow-worker-transport.js.map +1 -1
- package/dist/cluster-source.cjs +274 -509
- package/dist/cluster-source.cjs.map +3 -3
- package/dist/dist.dev.js +478 -450
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +121 -485
- package/dist/federated-table-scan-source.cjs.map +3 -3
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.cjs +16 -19
- package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.js +13 -18
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/geo-column/geo-column.cjs.map +1 -1
- package/dist/geoarrow/geo-column/geo-column.d.ts +1 -1
- package/dist/geoarrow/geo-column/geo-column.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
- package/dist/geoarrow/geoarrow-bounds.cjs.map +3 -3
- package/dist/geoarrow/geoarrow-bounds.js +3 -3
- package/dist/geoarrow/geoarrow-bounds.js.map +1 -1
- package/dist/geoarrow/geoarrow-capabilities.cjs +2 -2
- package/dist/geoarrow/geoarrow-capabilities.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-capabilities.js +1 -1
- package/dist/geoarrow/geoarrow-capabilities.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +13 -15
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +8 -11
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +6 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
- package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
- package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-inspection.js +1 -1
- package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
- package/dist/geoarrow/geoarrow-stream.cjs +10 -11
- package/dist/geoarrow/geoarrow-stream.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-stream.js +9 -12
- package/dist/geoarrow/geoarrow-stream.js.map +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.js +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
- package/dist/geoarrow/index.cjs +0 -3
- package/dist/geoarrow/index.cjs.map +2 -2
- package/dist/geoarrow/index.d.ts +0 -2
- package/dist/geoarrow/index.d.ts.map +1 -1
- package/dist/geoarrow/index.js +0 -1
- package/dist/geoarrow/index.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.cjs.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js +3 -3
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs +8 -9
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs.map +2 -2
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.d.ts.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +5 -9
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs +2 -2
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs.map +2 -2
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts.map +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs +4 -4
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -3
- 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.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs +3 -3
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js.map +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.cjs +2 -2
- package/dist/geoarrow/lib/kernels/geoarrow-union.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts.map +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.js +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.js.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +2 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.d.ts +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs +44 -2
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +4 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.js +3 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.js.map +1 -1
- package/dist/index.cjs +486 -410
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +20 -9
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +55 -45
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/encode.d.ts +1 -1
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +11 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +3 -2
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +3 -3
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +15 -19
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +7 -3
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +15 -67
- package/dist/lib/api/load.js.map +1 -1
- package/dist/lib/api/loader-options.d.ts +6 -0
- package/dist/lib/api/loader-options.d.ts.map +1 -1
- package/dist/lib/api/loader-options.js +48 -0
- package/dist/lib/api/loader-options.js.map +1 -1
- package/dist/lib/api/parse-file.d.ts +5 -3
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +8 -6
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +5 -3
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +60 -9
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +5 -3
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +3 -4
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +5 -3
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +22 -14
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/select-loader.d.ts +4 -2
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +47 -53
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/api/select-source.js +1 -1
- package/dist/lib/api/select-source.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +2 -2
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -37
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -63
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +13 -0
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -0
- package/dist/lib/loader-utils/native-arrow.js +66 -0
- package/dist/lib/loader-utils/native-arrow.js.map +1 -0
- package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +9 -10
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +0 -6
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +31 -114
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +3 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -1
- package/dist/loader-utils/index.cjs +257 -88
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +9 -4
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +5 -3
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts +23 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +32 -1
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts +5 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js +13 -5
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +48 -3
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +12 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +22 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.js +6 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +17 -11
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +53 -32
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.js +3 -13
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
- package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +2 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/tile-grid.d.ts +6 -1
- package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/tile-grid.js +32 -14
- package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +26 -15
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +114 -87
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.js.map +1 -1
- package/dist/loader-utils/source-types.d.ts +7 -5
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +9 -1
- package/dist/loader-utils/source-types.js.map +1 -1
- package/dist/loader-utils/tile-grid.cjs +21 -9
- package/dist/loader-utils/tile-grid.cjs.map +1 -1
- package/dist/null-loader.d.ts +0 -18
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -19
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +1 -1
- package/dist/null-worker.js +1 -1
- package/dist/polyfills/index.cjs +3 -2
- package/dist/polyfills/index.d.ts.map +1 -1
- package/dist/polyfills/index.js +2 -2
- package/dist/polyfills/index.js.map +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +36 -12
- package/dist/scan/arrow-execution/expressions.cjs.map +3 -3
- package/dist/scan/arrow-execution/expressions.d.ts +7 -4
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
- package/dist/scan/arrow-execution/expressions.js +32 -6
- package/dist/scan/arrow-execution/expressions.js.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +3 -18
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +2 -2
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js +3 -9
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs +41 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs.map +7 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts +5 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts.map +1 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js +23 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js.map +1 -0
- package/dist/scan/arrow-query-worker-entry.cjs +121 -0
- package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
- package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
- package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker-entry.js +7 -0
- package/dist/scan/arrow-query-worker-entry.js.map +1 -0
- package/dist/scan/arrow-query-worker.cjs +197 -0
- package/dist/scan/arrow-query-worker.cjs.map +7 -0
- package/dist/scan/arrow-query-worker.d.ts +47 -0
- package/dist/scan/arrow-query-worker.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker.js +101 -0
- package/dist/scan/arrow-query-worker.js.map +1 -0
- package/dist/scan/arrow-query.cjs +6 -2
- package/dist/scan/arrow-query.cjs.map +2 -2
- package/dist/scan/arrow-query.d.ts +3 -1
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/arrow-query.js +3 -1
- package/dist/scan/arrow-query.js.map +1 -1
- package/dist/scan/federated-table-scan-source.cjs +38 -39
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts +5 -9
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +35 -36
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +36 -12
- package/dist/scan/index.cjs.map +3 -3
- package/dist/scan/index.d.ts +11 -6
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +8 -5
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/parse-sql-predicate.cjs +2 -2
- package/dist/scan/parse-sql-predicate.cjs.map +2 -2
- package/dist/scan/parse-sql-predicate.js +1 -1
- package/dist/scan/parse-sql-predicate.js.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.cjs +60 -26
- package/dist/scan/query-arrow-table-in-batches.cjs.map +3 -3
- package/dist/scan/query-arrow-table-in-batches.d.ts +3 -3
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.js +52 -24
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -1
- package/dist/{geoarrow/get-geoarrow-native-geometry.cjs → scan/query-arrow-table-math.cjs} +18 -8
- package/dist/scan/query-arrow-table-math.cjs.map +7 -0
- package/dist/scan/query-arrow-table-math.d.ts +5 -0
- package/dist/scan/query-arrow-table-math.d.ts.map +1 -0
- package/dist/scan/query-arrow-table-math.js +14 -0
- package/dist/scan/query-arrow-table-math.js.map +1 -0
- package/dist/scan/query-arrow-table.cjs +32 -62
- package/dist/scan/query-arrow-table.cjs.map +2 -2
- package/dist/scan/query-arrow-table.d.ts +13 -8
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +35 -67
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-grouped-sql.cjs +66 -0
- package/dist/scan/query-grouped-sql.cjs.map +7 -0
- package/dist/scan/query-grouped-sql.d.ts +5 -0
- package/dist/scan/query-grouped-sql.d.ts.map +1 -0
- package/dist/scan/query-grouped-sql.js +58 -0
- package/dist/scan/query-grouped-sql.js.map +1 -0
- package/dist/scan/query-open-source.cjs +52 -0
- package/dist/scan/query-open-source.cjs.map +7 -0
- package/dist/scan/query-open-source.d.ts +4 -0
- package/dist/scan/query-open-source.d.ts.map +1 -0
- package/dist/scan/query-open-source.js +26 -0
- package/dist/scan/query-open-source.js.map +1 -0
- package/dist/scan/query-progressive.cjs +190 -0
- package/dist/scan/query-progressive.cjs.map +7 -0
- package/dist/scan/query-progressive.d.ts +41 -0
- package/dist/scan/query-progressive.d.ts.map +1 -0
- package/dist/scan/query-progressive.js +173 -0
- package/dist/scan/query-progressive.js.map +1 -0
- package/dist/scan/query-pushdown.cjs +140 -0
- package/dist/scan/query-pushdown.cjs.map +7 -0
- package/dist/scan/query-pushdown.d.ts +14 -0
- package/dist/scan/query-pushdown.d.ts.map +1 -0
- package/dist/scan/query-pushdown.js +133 -0
- package/dist/scan/query-pushdown.js.map +1 -0
- package/dist/scan/query-scales.cjs +195 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +47 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +201 -0
- package/dist/scan/query-scales.js.map +1 -0
- package/dist/scan/query.cjs +141 -92
- package/dist/scan/query.cjs.map +3 -3
- package/dist/scan/query.d.ts +37 -10
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +137 -96
- package/dist/scan/query.js.map +1 -1
- package/dist/scan/rows-to-arrow.cjs +1 -28
- package/dist/scan/rows-to-arrow.cjs.map +2 -2
- package/dist/scan/rows-to-arrow.d.ts +3 -3
- package/dist/scan/rows-to-arrow.d.ts.map +1 -1
- package/dist/scan/rows-to-arrow.js +2 -32
- package/dist/scan/rows-to-arrow.js.map +1 -1
- package/dist/scan/scan-engine.cjs +1 -1
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +5 -5
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js +1 -1
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +24 -17
- package/dist/scan/vector-table-scan-source.cjs.map +4 -4
- package/dist/scan/vector-table-scan-source.d.ts +8 -8
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +19 -17
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema/categories/category-mesh.d.ts +3 -10
- package/dist/schema/categories/category-mesh.d.ts.map +1 -1
- package/dist/schema/categories/category-mesh.js.map +1 -1
- package/dist/schema/categories/category-table.d.ts +2 -19
- package/dist/schema/categories/category-table.d.ts.map +1 -1
- package/dist/schema/float16.js +1 -1
- package/dist/schema/float16.js.map +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -1
- package/dist/schema/geometry/geoarrow.d.ts +2 -2
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
- package/dist/schema/index.cjs +14 -10
- package/dist/schema/index.cjs.map +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/types/batch.d.ts +0 -4
- package/dist/schema/types/batch.d.ts.map +1 -1
- package/dist/schema-utils/index.cjs +410 -626
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -6
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/converters/convert.js +9 -2
- package/dist/schema-utils/lib/converters/convert.js.map +1 -1
- package/dist/schema-utils/lib/converters/types.d.ts +2 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
- package/dist/schema-utils/lib/schema/data-type.js +1 -1
- package/dist/schema-utils/lib/schema/data-type.js.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +2 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.js +7 -3
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +9 -9
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +15 -76
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/row-utils.js +2 -2
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
- package/dist/vector-table-scan-source.cjs +241 -291
- package/dist/vector-table-scan-source.cjs.map +2 -2
- package/dist/wkt/index.cjs.map +1 -1
- package/dist/wkt/index.d.ts.map +1 -1
- package/dist/wkt/index.js.map +1 -1
- package/dist/worker-utils/index.cjs +51 -11
- package/dist/worker-utils/index.cjs.map +3 -3
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js +2 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -1
- package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -1
- package/dist/worker-utils/lib/npm-tag.js.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +8 -7
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +5 -2
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +4 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +2 -2
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +1 -6
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -1
- package/dist/worker-utils/null-worker-node.js.map +1 -1
- package/dist/worker-utils/null-worker.js.map +1 -1
- package/package.json +102 -12
- package/src/arrow-geometry/binary-features.ts +4 -1
- package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
- package/src/arrow-geometry/feature-collection-to-arrow.ts +4 -3
- package/src/arrow-geometry/feature-table.ts +8 -17
- package/src/arrow-geometry/geojson-table.ts +32 -21
- package/src/arrow-geometry/geometry-codecs.ts +2 -2
- package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
- package/src/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.ts +3 -1
- package/src/arrow-geometry/wkb-arrow-utils.ts +8 -12
- package/src/arrow-geometry/wkb-builder.ts +2 -2
- package/src/arrow-geometry/wkb-statistics.ts +2 -2
- package/src/arrow-worker-transport.ts +89 -50
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +20 -30
- package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
- package/src/geoarrow/geo-column/geo-column.ts +1 -1
- package/src/geoarrow/geoarrow-bounds.ts +3 -3
- package/src/geoarrow/geoarrow-capabilities.ts +1 -1
- package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +12 -15
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +15 -15
- package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
- package/src/geoarrow/index.ts +0 -2
- package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts +3 -3
- package/src/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.ts +8 -12
- package/src/geoarrow/lib/geoarrow/geoarrow-union-kind.ts +1 -1
- package/src/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +1 -1
- package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +2 -2
- package/src/geoarrow/lib/kernels/encode-geoarrow-box.ts +1 -1
- package/src/geoarrow/lib/kernels/geoarrow-union.ts +1 -1
- package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +11 -11
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +4 -3
- package/src/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.ts +1 -1
- package/src/geoarrow/mesharrow/get-deck-binary-data.ts +1 -1
- package/src/geoarrow/mesharrow/mesh-accessors.ts +1 -1
- package/src/geoarrow/metadata/geoarrow-metadata.ts +3 -4
- package/src/index.ts +2 -6
- package/src/lib/api/create-data-source.ts +148 -58
- package/src/lib/api/encode.ts +14 -3
- package/src/lib/api/load-in-batches.ts +15 -7
- package/src/lib/api/load-loader.ts +22 -21
- package/src/lib/api/load.ts +51 -127
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +32 -22
- package/src/lib/api/parse-in-batches.ts +121 -20
- package/src/lib/api/parse-sync.ts +30 -16
- package/src/lib/api/parse.ts +46 -29
- package/src/lib/api/select-loader.ts +54 -69
- package/src/lib/api/select-source.ts +7 -1
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +2 -70
- package/src/lib/loader-utils/native-arrow.ts +83 -0
- package/src/lib/loader-utils/option-defaults.ts +9 -10
- package/src/lib/loader-utils/option-utils.ts +33 -122
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +19 -3
- package/src/loader-utils/lib/log-utils/log.ts +36 -1
- package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
- package/src/loader-utils/lib/scan-utils/logical-table-query.ts +18 -8
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +68 -6
- package/src/loader-utils/lib/scan-utils/table-query.ts +28 -1
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +88 -56
- package/src/loader-utils/lib/sources/data-source.ts +3 -15
- package/src/loader-utils/lib/sources/image-source.ts +1 -1
- package/src/loader-utils/lib/sources/table-source-collection.ts +2 -1
- package/src/loader-utils/lib/sources/tile-grid.ts +34 -18
- package/src/loader-utils/lib/sources/utils/utils.ts +1 -1
- package/src/loader-utils/lib/sources/vector-source.ts +3 -3
- package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +27 -18
- package/src/loader-utils/loader-types.ts +186 -107
- package/src/loader-utils/source-types.ts +17 -6
- package/src/null-loader.ts +1 -20
- package/src/polyfills/index.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +42 -7
- package/src/scan/arrow-execution/filter-arrow-table.ts +3 -18
- package/src/scan/arrow-execution/portable-predicate-compatibility.ts +27 -0
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/arrow-query.ts +3 -1
- package/src/scan/federated-table-scan-source.ts +48 -59
- package/src/scan/index.ts +41 -11
- package/src/scan/parse-sql-predicate.ts +1 -1
- package/src/scan/query-arrow-table-in-batches.ts +62 -33
- package/src/scan/query-arrow-table-math.ts +23 -0
- package/src/scan/query-arrow-table.ts +62 -97
- package/src/scan/query-grouped-sql.ts +69 -0
- package/src/scan/query-open-source.ts +39 -0
- package/src/scan/query-progressive.ts +230 -0
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +299 -0
- package/src/scan/query.ts +254 -127
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +7 -7
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/float16.ts +1 -1
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +2 -2
- package/src/schema/index.ts +4 -5
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +20 -11
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
- package/src/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.ts +1 -1
- package/src/schema-utils/lib/converters/convert.ts +7 -2
- package/src/schema-utils/lib/converters/types.ts +2 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
- package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
- package/src/schema-utils/lib/schema/data-type.ts +1 -1
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +8 -4
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +21 -51
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
- package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
- package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +29 -96
- package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
- package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
- package/src/schema-utils/lib/table/tables/row-utils.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/wkt/index.ts +1 -1
- package/src/worker-utils/lib/library-utils/library-utils.ts +2 -1
- package/src/worker-utils/lib/npm-tag.ts +1 -1
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +8 -7
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +4 -3
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +7 -4
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +1 -6
- package/dist/arrow-geometry/native-geometry.cjs +0 -215
- package/dist/arrow-geometry/native-geometry.cjs.map +0 -7
- package/dist/arrow-geometry/native-geometry.d.ts +0 -41
- package/dist/arrow-geometry/native-geometry.d.ts.map +0 -1
- package/dist/arrow-geometry/native-geometry.js +0 -224
- package/dist/arrow-geometry/native-geometry.js.map +0 -1
- package/dist/geoarrow/get-geoarrow-native-geometry.cjs.map +0 -7
- package/dist/geoarrow/get-geoarrow-native-geometry.d.ts +0 -2
- package/dist/geoarrow/get-geoarrow-native-geometry.d.ts.map +0 -1
- package/dist/geoarrow/get-geoarrow-native-geometry.js +0 -5
- package/dist/geoarrow/get-geoarrow-native-geometry.js.map +0 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs +0 -290
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs.map +0 -7
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts +0 -16
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts.map +0 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js +0 -334
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
- package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
- package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
- package/dist/schema/deprecated/mesh-utils.js +0 -37
- package/dist/schema/deprecated/mesh-utils.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js +0 -5
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
- package/src/arrow-geometry/native-geometry.ts +0 -278
- package/src/geoarrow/get-geoarrow-native-geometry.ts +0 -8
- package/src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts +0 -373
- package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
- package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
- package/src/schema/deprecated/mesh-utils.ts +0 -46
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
package/dist/index.cjs
CHANGED
|
@@ -23,16 +23,17 @@ __export(index_exports, {
|
|
|
23
23
|
FetchError: () => FetchError,
|
|
24
24
|
JSONLoader: () => JSONLoader,
|
|
25
25
|
NullLoader: () => NullLoader,
|
|
26
|
-
NullWorkerLoader: () => NullWorkerLoader,
|
|
27
26
|
RequestScheduler: () => RequestScheduler,
|
|
28
27
|
_BrowserFileSystem: () => BrowserFileSystem,
|
|
29
28
|
_fetchProgress: () => fetchProgress,
|
|
30
29
|
_selectSource: () => selectSource,
|
|
31
30
|
_unregisterLoaders: () => _unregisterLoaders,
|
|
32
31
|
assert: () => assert,
|
|
32
|
+
compareLoaderOptions: () => compareLoaderOptions,
|
|
33
33
|
concatenateArrayBuffersAsync: () => concatenateArrayBuffersAsync,
|
|
34
34
|
coreApi: () => coreApi,
|
|
35
35
|
createDataSource: () => createDataSource,
|
|
36
|
+
createDataSourceSync: () => createDataSourceSync,
|
|
36
37
|
document: () => document_,
|
|
37
38
|
encode: () => encode,
|
|
38
39
|
encodeInBatches: () => encodeInBatches,
|
|
@@ -115,15 +116,45 @@ var import_log = require("probe.gl/log");
|
|
|
115
116
|
var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
116
117
|
var version = VERSION[0] >= "0" && VERSION[0] <= "9" ? `v${VERSION}` : "";
|
|
117
118
|
function createLog() {
|
|
118
|
-
const
|
|
119
|
+
const log3 = new import_log.Log({ id: "loaders.gl" });
|
|
119
120
|
globalThis.loaders ||= {};
|
|
120
|
-
globalThis.loaders.log =
|
|
121
|
+
globalThis.loaders.log = log3;
|
|
121
122
|
globalThis.loaders.version = version;
|
|
122
123
|
globalThis.probe ||= {};
|
|
123
|
-
globalThis.probe.loaders =
|
|
124
|
-
return
|
|
124
|
+
globalThis.probe.loaders = log3;
|
|
125
|
+
return log3;
|
|
125
126
|
}
|
|
126
127
|
var log = createLog();
|
|
128
|
+
var NullLog = class {
|
|
129
|
+
/** Discards debug messages. */
|
|
130
|
+
log() {
|
|
131
|
+
return ignoreMessage;
|
|
132
|
+
}
|
|
133
|
+
/** Discards informational messages. */
|
|
134
|
+
info() {
|
|
135
|
+
return ignoreMessage;
|
|
136
|
+
}
|
|
137
|
+
/** Discards messages marked to be emitted once. */
|
|
138
|
+
once() {
|
|
139
|
+
return ignoreMessage;
|
|
140
|
+
}
|
|
141
|
+
/** Discards warnings. */
|
|
142
|
+
warn() {
|
|
143
|
+
return ignoreMessage;
|
|
144
|
+
}
|
|
145
|
+
/** Discards errors. */
|
|
146
|
+
error() {
|
|
147
|
+
return ignoreMessage;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
function ignoreMessage() {
|
|
151
|
+
}
|
|
152
|
+
var nullLog = new NullLog();
|
|
153
|
+
function getLoaderLog(options) {
|
|
154
|
+
var _a;
|
|
155
|
+
const logger = (_a = options == null ? void 0 : options.core) == null ? void 0 : _a.log;
|
|
156
|
+
return logger === null ? nullLog : logger || log;
|
|
157
|
+
}
|
|
127
158
|
|
|
128
159
|
// src/loader-utils/lib/javascript-utils/is-type.ts
|
|
129
160
|
var isBoolean = (value) => typeof value === "boolean";
|
|
@@ -183,10 +214,10 @@ var NPM_TAG = "beta";
|
|
|
183
214
|
|
|
184
215
|
// src/worker-utils/lib/env-utils/version.ts
|
|
185
216
|
function getVersion() {
|
|
186
|
-
const
|
|
217
|
+
const version3 = typeof __VERSION__ === "undefined" ? NPM_TAG : __VERSION__;
|
|
187
218
|
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
188
|
-
globalThis._loadersgl_.version ||=
|
|
189
|
-
return
|
|
219
|
+
globalThis._loadersgl_.version ||= version3;
|
|
220
|
+
return version3;
|
|
190
221
|
}
|
|
191
222
|
var VERSION2 = getVersion();
|
|
192
223
|
|
|
@@ -250,11 +281,11 @@ function getWorkerURL(worker, options = {}) {
|
|
|
250
281
|
}
|
|
251
282
|
function getDefaultWorkerURL(worker, warn = false) {
|
|
252
283
|
const workerFile = isBrowser2 ? worker.workerFile || `${worker.id}-worker.js` : worker.workerNode || `${worker.id}-worker-node.js`;
|
|
253
|
-
let
|
|
254
|
-
if (
|
|
255
|
-
|
|
284
|
+
let version3 = worker.version;
|
|
285
|
+
if (version3 === "latest") {
|
|
286
|
+
version3 = NPM_TAG;
|
|
256
287
|
}
|
|
257
|
-
const versionTag =
|
|
288
|
+
const versionTag = version3 ? `@${version3}` : "";
|
|
258
289
|
const url = `https://unpkg.com/@loaders.gl/${worker.module}${versionTag}/dist/${workerFile}`;
|
|
259
290
|
if (warn) {
|
|
260
291
|
warnIfUsingNpmTagFallback(worker, url);
|
|
@@ -270,9 +301,9 @@ function warnIfUsingNpmTagFallback(worker, url) {
|
|
|
270
301
|
return;
|
|
271
302
|
}
|
|
272
303
|
warnedWorkerVersionFallbacks.add(workerId);
|
|
273
|
-
|
|
304
|
+
log.warn(
|
|
274
305
|
`loaders.gl: ${worker.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${url} from CDN.`
|
|
275
|
-
);
|
|
306
|
+
)();
|
|
276
307
|
}
|
|
277
308
|
|
|
278
309
|
// src/worker-utils/lib/worker-api/task-runtime.ts
|
|
@@ -410,8 +441,8 @@ function getControls(options) {
|
|
|
410
441
|
};
|
|
411
442
|
}
|
|
412
443
|
function getParserOptions(options) {
|
|
413
|
-
const { signal, onProgress,
|
|
414
|
-
return getTransferListForWriter(parserOptions);
|
|
444
|
+
const { signal, onProgress, parserOptions, ...workerOptions } = options;
|
|
445
|
+
return getTransferListForWriter(parserOptions ?? workerOptions);
|
|
415
446
|
}
|
|
416
447
|
async function openSession(worker, options, context, jobContext) {
|
|
417
448
|
var _a, _b;
|
|
@@ -572,8 +603,7 @@ function canParseWithWorker(loader, options) {
|
|
|
572
603
|
(credential) => credential.type === "request" || "token" in credential && typeof credential.token === "function"
|
|
573
604
|
))
|
|
574
605
|
return false;
|
|
575
|
-
if (loader.id === "shapefile" &&
|
|
576
|
-
return false;
|
|
606
|
+
if (loader.id === "shapefile" && typeof ((_e = options == null ? void 0 : options.core) == null ? void 0 : _e.fetch) === "function") return false;
|
|
577
607
|
const workerOptions = getWorkerOptions(options);
|
|
578
608
|
const nodeWorkers = workerOptions._nodeWorkers;
|
|
579
609
|
if (!isBrowser2 && !nodeWorkers) {
|
|
@@ -726,13 +756,19 @@ function resolveWorkerLoaders(loader, loaderIds, loaderIsArray, context, options
|
|
|
726
756
|
}
|
|
727
757
|
}
|
|
728
758
|
function getWorkerOptions(options = {}, loader) {
|
|
729
|
-
var _a;
|
|
759
|
+
var _a, _b;
|
|
730
760
|
const portableOptions = ((_a = loader == null ? void 0 : loader.serializeWorkerOptions) == null ? void 0 : _a.call(loader, options)) || options;
|
|
731
761
|
const optionsToSerialize = {
|
|
732
762
|
...portableOptions,
|
|
733
763
|
signal: void 0,
|
|
734
764
|
onProgress: void 0,
|
|
735
|
-
...portableOptions.core ? {
|
|
765
|
+
...portableOptions.core ? {
|
|
766
|
+
core: {
|
|
767
|
+
...portableOptions.core,
|
|
768
|
+
authentications: void 0,
|
|
769
|
+
log: isDisabledLog(portableOptions.core.log) ? null : void 0
|
|
770
|
+
}
|
|
771
|
+
} : {}
|
|
736
772
|
};
|
|
737
773
|
const serializedOptions = JSON.parse(
|
|
738
774
|
JSON.stringify(optionsToSerialize, (_key, value) => {
|
|
@@ -743,17 +779,17 @@ function getWorkerOptions(options = {}, loader) {
|
|
|
743
779
|
})
|
|
744
780
|
);
|
|
745
781
|
restoreBigIntOptions(optionsToSerialize, serializedOptions);
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
...serializedOptions
|
|
749
|
-
};
|
|
750
|
-
if (workerOptions.worker === "auto") {
|
|
751
|
-
workerOptions.worker = true;
|
|
782
|
+
if (((_b = serializedOptions.core) == null ? void 0 : _b.worker) === "auto") {
|
|
783
|
+
serializedOptions.core.worker = true;
|
|
752
784
|
}
|
|
753
785
|
if (loader) {
|
|
754
|
-
|
|
786
|
+
serializedOptions._workerLoaderId = loader.id;
|
|
755
787
|
}
|
|
756
|
-
return
|
|
788
|
+
return {
|
|
789
|
+
...serializedOptions,
|
|
790
|
+
...serializedOptions.core,
|
|
791
|
+
parserOptions: serializedOptions
|
|
792
|
+
};
|
|
757
793
|
}
|
|
758
794
|
function restoreBigIntOptions(original, serialized) {
|
|
759
795
|
if (!serialized || typeof serialized !== "object") return;
|
|
@@ -783,11 +819,14 @@ function getSerializableLoaderContext(context) {
|
|
|
783
819
|
function shouldParseCSVWithWorker(options) {
|
|
784
820
|
var _a, _b;
|
|
785
821
|
const csvOptions = options;
|
|
786
|
-
return (((_a = csvOptions == null ? void 0 : csvOptions.csv) == null ? void 0 : _a.shape) ?? ((_b = csvOptions == null ? void 0 : csvOptions.core) == null ? void 0 : _b.shape)) === "arrow
|
|
822
|
+
return (((_a = csvOptions == null ? void 0 : csvOptions.csv) == null ? void 0 : _a.shape) ?? ((_b = csvOptions == null ? void 0 : csvOptions.core) == null ? void 0 : _b.shape)) === "arrow";
|
|
787
823
|
}
|
|
788
824
|
function isLoaderWithWorkerResultDeserializer(loader) {
|
|
789
825
|
return typeof loader.deserializeWorkerResult === "function";
|
|
790
826
|
}
|
|
827
|
+
function isDisabledLog(logger) {
|
|
828
|
+
return logger === null || logger instanceof NullLog;
|
|
829
|
+
}
|
|
791
830
|
|
|
792
831
|
// src/loader-utils/lib/worker-loader-utils/encode-with-worker.ts
|
|
793
832
|
function canEncodeWithWorker(writer, options) {
|
|
@@ -1704,9 +1743,50 @@ var NodeFileFacade = class {
|
|
|
1704
1743
|
}
|
|
1705
1744
|
};
|
|
1706
1745
|
|
|
1707
|
-
// src/loader-utils/
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1746
|
+
// src/loader-utils/lib/pace-batch-iterator.ts
|
|
1747
|
+
function validateBatchDeliveryRate(rate) {
|
|
1748
|
+
if (!Number.isFinite(rate) || rate < 0) {
|
|
1749
|
+
throw new RangeError("core.batchMaxRowsPerSecond must be a finite nonnegative number");
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
async function* paceBatchIterator(batches, { batchMaxRowsPerSecond = 0, getRowCount, signal }) {
|
|
1753
|
+
validateBatchDeliveryRate(batchMaxRowsPerSecond);
|
|
1754
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
1755
|
+
if (batchMaxRowsPerSecond === 0) {
|
|
1756
|
+
yield* batches;
|
|
1757
|
+
return;
|
|
1758
|
+
}
|
|
1759
|
+
let deadline = 0;
|
|
1760
|
+
for await (const batch of batches) {
|
|
1761
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
1762
|
+
const rowCount = getRowCount(batch);
|
|
1763
|
+
if (rowCount !== void 0 && rowCount > 0) {
|
|
1764
|
+
let remaining = deadline - performance.now();
|
|
1765
|
+
while (remaining > 0) {
|
|
1766
|
+
await waitForBatch(Math.min(Math.ceil(remaining), 2 ** 31 - 1), signal);
|
|
1767
|
+
remaining = deadline - performance.now();
|
|
1768
|
+
}
|
|
1769
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
1770
|
+
deadline = performance.now() + rowCount / batchMaxRowsPerSecond * 1e3;
|
|
1771
|
+
}
|
|
1772
|
+
yield batch;
|
|
1773
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
function waitForBatch(delay, signal) {
|
|
1777
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
1778
|
+
return new Promise((resolve2, reject) => {
|
|
1779
|
+
const timer = setTimeout(() => {
|
|
1780
|
+
signal == null ? void 0 : signal.removeEventListener("abort", abort);
|
|
1781
|
+
resolve2();
|
|
1782
|
+
}, delay);
|
|
1783
|
+
function abort() {
|
|
1784
|
+
clearTimeout(timer);
|
|
1785
|
+
signal == null ? void 0 : signal.removeEventListener("abort", abort);
|
|
1786
|
+
reject(signal == null ? void 0 : signal.reason);
|
|
1787
|
+
}
|
|
1788
|
+
signal == null ? void 0 : signal.addEventListener("abort", abort, { once: true });
|
|
1789
|
+
});
|
|
1710
1790
|
}
|
|
1711
1791
|
|
|
1712
1792
|
// dist/lib/fetch/fetch-error.js
|
|
@@ -1933,71 +2013,47 @@ async function readBlob(blob) {
|
|
|
1933
2013
|
}
|
|
1934
2014
|
|
|
1935
2015
|
// dist/lib/loader-utils/loggers.js
|
|
1936
|
-
var
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
2016
|
+
var import_log6 = require("probe.gl/log");
|
|
2017
|
+
|
|
2018
|
+
// dist/loader-utils/lib/log-utils/log.js
|
|
2019
|
+
var import_log5 = require("probe.gl/log");
|
|
2020
|
+
var VERSION4 = true ? "5.0.0-rc.1" : "latest";
|
|
2021
|
+
var version2 = VERSION4[0] >= "0" && VERSION4[0] <= "9" ? `v${VERSION4}` : "";
|
|
2022
|
+
function createLog2() {
|
|
2023
|
+
const log3 = new import_log5.Log({ id: "loaders.gl" });
|
|
2024
|
+
globalThis.loaders ||= {};
|
|
2025
|
+
globalThis.loaders.log = log3;
|
|
2026
|
+
globalThis.loaders.version = version2;
|
|
2027
|
+
globalThis.probe ||= {};
|
|
2028
|
+
globalThis.probe.loaders = log3;
|
|
2029
|
+
return log3;
|
|
2030
|
+
}
|
|
2031
|
+
var log2 = createLog2();
|
|
2032
|
+
var NullLog2 = class {
|
|
2033
|
+
/** Discards debug messages. */
|
|
1940
2034
|
log() {
|
|
1941
|
-
return
|
|
1942
|
-
};
|
|
2035
|
+
return ignoreMessage2;
|
|
1943
2036
|
}
|
|
1944
|
-
/**
|
|
2037
|
+
/** Discards informational messages. */
|
|
1945
2038
|
info() {
|
|
1946
|
-
return
|
|
1947
|
-
};
|
|
2039
|
+
return ignoreMessage2;
|
|
1948
2040
|
}
|
|
1949
|
-
/**
|
|
2041
|
+
/** Discards messages marked to be emitted once. */
|
|
1950
2042
|
once() {
|
|
1951
|
-
return
|
|
1952
|
-
};
|
|
2043
|
+
return ignoreMessage2;
|
|
1953
2044
|
}
|
|
1954
|
-
/**
|
|
2045
|
+
/** Discards warnings. */
|
|
1955
2046
|
warn() {
|
|
1956
|
-
return
|
|
1957
|
-
};
|
|
2047
|
+
return ignoreMessage2;
|
|
1958
2048
|
}
|
|
1959
|
-
/**
|
|
2049
|
+
/** Discards errors. */
|
|
1960
2050
|
error() {
|
|
1961
|
-
return
|
|
1962
|
-
};
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
|
-
var ConsoleLog = class {
|
|
1966
|
-
/** Console-like object used for message output. */
|
|
1967
|
-
console;
|
|
1968
|
-
/** Messages already emitted through `once`. */
|
|
1969
|
-
onceMessages = /* @__PURE__ */ new Set();
|
|
1970
|
-
/** Creates a console-backed logger. */
|
|
1971
|
-
constructor() {
|
|
1972
|
-
this.console = console;
|
|
1973
|
-
}
|
|
1974
|
-
/** Logs a message to the console. */
|
|
1975
|
-
log(...args) {
|
|
1976
|
-
return this.console.log.bind(this.console, ...args);
|
|
1977
|
-
}
|
|
1978
|
-
/** Logs an informational message to the console. */
|
|
1979
|
-
info(...args) {
|
|
1980
|
-
return this.console.info.bind(this.console, ...args);
|
|
1981
|
-
}
|
|
1982
|
-
/** Logs one message once to the console. */
|
|
1983
|
-
once(...args) {
|
|
1984
|
-
const message = String(args[0]);
|
|
1985
|
-
if (this.onceMessages.has(message)) {
|
|
1986
|
-
return () => {
|
|
1987
|
-
};
|
|
1988
|
-
}
|
|
1989
|
-
this.onceMessages.add(message);
|
|
1990
|
-
return this.console.info.bind(this.console, ...args);
|
|
1991
|
-
}
|
|
1992
|
-
/** Logs a warning message to the console. */
|
|
1993
|
-
warn(...args) {
|
|
1994
|
-
return this.console.warn.bind(this.console, ...args);
|
|
1995
|
-
}
|
|
1996
|
-
/** Logs an error message to the console. */
|
|
1997
|
-
error(...args) {
|
|
1998
|
-
return this.console.error.bind(this.console, ...args);
|
|
2051
|
+
return ignoreMessage2;
|
|
1999
2052
|
}
|
|
2000
2053
|
};
|
|
2054
|
+
function ignoreMessage2() {
|
|
2055
|
+
}
|
|
2056
|
+
var nullLog2 = new NullLog2();
|
|
2001
2057
|
|
|
2002
2058
|
// dist/lib/loader-utils/option-defaults.js
|
|
2003
2059
|
var DEFAULT_LOADER_OPTIONS = {
|
|
@@ -2011,8 +2067,7 @@ var DEFAULT_LOADER_OPTIONS = {
|
|
|
2011
2067
|
ignoreRegisteredLoaders: void 0,
|
|
2012
2068
|
nothrow: false,
|
|
2013
2069
|
shape: void 0,
|
|
2014
|
-
log:
|
|
2015
|
-
// A probe.gl compatible (`log.log()()` syntax) that just logs to console
|
|
2070
|
+
log: log2,
|
|
2016
2071
|
useLocalLibraries: false,
|
|
2017
2072
|
subloaders: void 0,
|
|
2018
2073
|
CDN: "https://unpkg.com/@loaders.gl",
|
|
@@ -2030,18 +2085,17 @@ var DEFAULT_LOADER_OPTIONS = {
|
|
|
2030
2085
|
// By default do not support node workers
|
|
2031
2086
|
_workerType: "",
|
|
2032
2087
|
// 'test' to use locally generated workers
|
|
2033
|
-
limit: 0,
|
|
2034
|
-
_limitMB: 0,
|
|
2035
2088
|
batchSize: "auto",
|
|
2036
|
-
|
|
2089
|
+
batchMaxRowsPerSecond: 0,
|
|
2037
2090
|
metadata: false,
|
|
2038
2091
|
// TODO - currently only implemented for parseInBatches, adds initial metadata batch,
|
|
2039
2092
|
transforms: []
|
|
2040
2093
|
}
|
|
2041
2094
|
};
|
|
2042
2095
|
var REMOVED_LOADER_OPTIONS = {
|
|
2043
|
-
//
|
|
2096
|
+
// Removed top-level aliases
|
|
2044
2097
|
baseUri: "core.baseUrl",
|
|
2098
|
+
baseUrl: "core.baseUrl",
|
|
2045
2099
|
fetch: "core.fetch",
|
|
2046
2100
|
mimeType: "core.mimeType",
|
|
2047
2101
|
fallbackMimeType: "core.fallbackMimeType",
|
|
@@ -2051,17 +2105,17 @@ var REMOVED_LOADER_OPTIONS = {
|
|
|
2051
2105
|
useLocalLibraries: "core.useLocalLibraries",
|
|
2052
2106
|
CDN: "core.CDN",
|
|
2053
2107
|
worker: "core.worker",
|
|
2108
|
+
workerThreshold: "core.workerThreshold",
|
|
2109
|
+
workerTransferBufferCopy: "core.workerTransferBufferCopy",
|
|
2054
2110
|
maxConcurrency: "core.maxConcurrency",
|
|
2055
2111
|
maxMobileConcurrency: "core.maxMobileConcurrency",
|
|
2056
2112
|
reuseWorkers: "core.reuseWorkers",
|
|
2057
|
-
_nodeWorkers: "core.
|
|
2113
|
+
_nodeWorkers: "core._nodeWorkers",
|
|
2058
2114
|
_workerType: "core._workerType",
|
|
2059
2115
|
_worker: "core._workerType",
|
|
2060
|
-
limit: "core.limit",
|
|
2061
|
-
_limitMB: "core._limitMB",
|
|
2062
2116
|
shape: "core.shape",
|
|
2063
2117
|
batchSize: "core.batchSize",
|
|
2064
|
-
batchDebounceMs: "core.
|
|
2118
|
+
batchDebounceMs: "(removed; use core.batchMaxRowsPerSecond)",
|
|
2065
2119
|
metadata: "core.metadata",
|
|
2066
2120
|
transforms: "core.transforms",
|
|
2067
2121
|
// Older deprecations
|
|
@@ -2083,33 +2137,50 @@ var REMOVED_LOADER_OPTIONS = {
|
|
|
2083
2137
|
signal: "core.fetch.signal"
|
|
2084
2138
|
};
|
|
2085
2139
|
|
|
2140
|
+
// dist/lib/loader-utils/native-arrow.js
|
|
2141
|
+
function getShapeOptionKey(loader) {
|
|
2142
|
+
const keys = Object.keys(loader.options || {}).filter((key) => {
|
|
2143
|
+
var _a;
|
|
2144
|
+
const value = (_a = loader.options) == null ? void 0 : _a[key];
|
|
2145
|
+
return key !== "core" && value && typeof value === "object" && "shape" in value;
|
|
2146
|
+
});
|
|
2147
|
+
return keys.includes(loader.id) ? loader.id : keys.length === 1 ? keys[0] : void 0;
|
|
2148
|
+
}
|
|
2149
|
+
function usesNativeArrowBatches(loader, options) {
|
|
2150
|
+
var _a;
|
|
2151
|
+
const key = getShapeOptionKey(loader);
|
|
2152
|
+
const scopedOptions = key && options[key];
|
|
2153
|
+
if (!scopedOptions || typeof scopedOptions !== "object" || !("shape" in scopedOptions) || scopedOptions.shape !== "arrow") {
|
|
2154
|
+
return false;
|
|
2155
|
+
}
|
|
2156
|
+
if ((_a = options.core) == null ? void 0 : _a.metadata) {
|
|
2157
|
+
throw new Error('shape: "arrow" carries metadata in the Arrow schema and does not support core.metadata envelopes');
|
|
2158
|
+
}
|
|
2159
|
+
return true;
|
|
2160
|
+
}
|
|
2161
|
+
async function* normalizeNativeArrowBatches(batches) {
|
|
2162
|
+
for await (const batch of batches) {
|
|
2163
|
+
const batchType = batch == null ? void 0 : batch.batchType;
|
|
2164
|
+
if (batchType === "metadata" || batchType === "partial-result" || batchType === "final-result") {
|
|
2165
|
+
continue;
|
|
2166
|
+
}
|
|
2167
|
+
if (isArrowRecordBatch(batch)) {
|
|
2168
|
+
yield batch;
|
|
2169
|
+
} else if (isArrowTable(batch)) {
|
|
2170
|
+
yield* batch.batches;
|
|
2171
|
+
} else {
|
|
2172
|
+
throw new Error('shape: "arrow" requires a native Arrow table or record batch');
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
function isArrowTable(value) {
|
|
2177
|
+
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");
|
|
2178
|
+
}
|
|
2179
|
+
function isArrowRecordBatch(value) {
|
|
2180
|
+
return Boolean(value && typeof value === "object" && value[/* @__PURE__ */ Symbol.for("apache-arrow/RecordBatch")] === true);
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2086
2183
|
// dist/lib/loader-utils/option-utils.js
|
|
2087
|
-
var CORE_LOADER_OPTION_KEYS = [
|
|
2088
|
-
"baseUrl",
|
|
2089
|
-
"fetch",
|
|
2090
|
-
"mimeType",
|
|
2091
|
-
"fallbackMimeType",
|
|
2092
|
-
"ignoreRegisteredLoaders",
|
|
2093
|
-
"nothrow",
|
|
2094
|
-
"log",
|
|
2095
|
-
"useLocalLibraries",
|
|
2096
|
-
"CDN",
|
|
2097
|
-
"worker",
|
|
2098
|
-
"workerThreshold",
|
|
2099
|
-
"maxConcurrency",
|
|
2100
|
-
"maxMobileConcurrency",
|
|
2101
|
-
"reuseWorkers",
|
|
2102
|
-
"workerTransferBufferCopy",
|
|
2103
|
-
"_nodeWorkers",
|
|
2104
|
-
"_workerType",
|
|
2105
|
-
"limit",
|
|
2106
|
-
"_limitMB",
|
|
2107
|
-
"shape",
|
|
2108
|
-
"batchSize",
|
|
2109
|
-
"batchDebounceMs",
|
|
2110
|
-
"metadata",
|
|
2111
|
-
"transforms"
|
|
2112
|
-
];
|
|
2113
2184
|
function applySearchParamsToUrl(url, options) {
|
|
2114
2185
|
const searchParams = options == null ? void 0 : options.searchParams;
|
|
2115
2186
|
if (!searchParams || Object.keys(searchParams).length === 0 || /^(?:data|blob):/i.test(url)) {
|
|
@@ -2145,12 +2216,15 @@ function getGlobalLoaderOptions() {
|
|
|
2145
2216
|
...DEFAULT_LOADER_OPTIONS,
|
|
2146
2217
|
core: { ...DEFAULT_LOADER_OPTIONS.core }
|
|
2147
2218
|
};
|
|
2148
|
-
return
|
|
2219
|
+
return cloneLoaderOptions(state.globalOptions);
|
|
2149
2220
|
}
|
|
2150
2221
|
function setGlobalOptions(options) {
|
|
2151
2222
|
const state = getGlobalLoaderState();
|
|
2152
2223
|
const globalOptions = getGlobalLoaderOptions();
|
|
2153
|
-
|
|
2224
|
+
validateOptions(options, []);
|
|
2225
|
+
validateWorkerThreshold(options);
|
|
2226
|
+
mergeNestedFields(globalOptions, options);
|
|
2227
|
+
state.globalOptions = globalOptions;
|
|
2154
2228
|
registerJSModules(options.modules);
|
|
2155
2229
|
}
|
|
2156
2230
|
function normalizeOptions(options, loader, loaders, url) {
|
|
@@ -2158,23 +2232,10 @@ function normalizeOptions(options, loader, loaders, url) {
|
|
|
2158
2232
|
loaders = Array.isArray(loaders) ? loaders : [loaders];
|
|
2159
2233
|
validateOptions(options, loaders);
|
|
2160
2234
|
validateWorkerThreshold(options);
|
|
2161
|
-
const normalizedOptions =
|
|
2235
|
+
const normalizedOptions = normalizeOptionsInternal(loader, options, url);
|
|
2162
2236
|
validateWorkerThreshold(normalizedOptions);
|
|
2163
2237
|
return normalizedOptions;
|
|
2164
2238
|
}
|
|
2165
|
-
function normalizeLoaderOptions(options) {
|
|
2166
|
-
const normalized = cloneLoaderOptions(options);
|
|
2167
|
-
moveDeprecatedTopLevelOptionsToCore(normalized);
|
|
2168
|
-
for (const key of CORE_LOADER_OPTION_KEYS) {
|
|
2169
|
-
if (normalized.core && normalized.core[key] !== void 0) {
|
|
2170
|
-
delete normalized[key];
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
if (normalized.core && normalized.core._workerType !== void 0) {
|
|
2174
|
-
delete normalized._worker;
|
|
2175
|
-
}
|
|
2176
|
-
return normalized;
|
|
2177
|
-
}
|
|
2178
2239
|
function validateOptions(options, loaders) {
|
|
2179
2240
|
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
2180
2241
|
for (const loader of loaders) {
|
|
@@ -2196,17 +2257,17 @@ function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, l
|
|
|
2196
2257
|
const prefix = id ? `${id}.` : "";
|
|
2197
2258
|
for (const key in options) {
|
|
2198
2259
|
const isSubOptions = !id && isObject(options[key]);
|
|
2199
|
-
const
|
|
2260
|
+
const isLifecycleOption = !id && ["signal", "onProgress"].includes(key);
|
|
2200
2261
|
const isWorkerUrlOption = key === "workerUrl" && id;
|
|
2201
|
-
if (!(key in defaultOptions) && !
|
|
2262
|
+
if (!(key in defaultOptions) && !isLifecycleOption && !isWorkerUrlOption) {
|
|
2202
2263
|
if (key in deprecatedOptions) {
|
|
2203
|
-
if (
|
|
2204
|
-
|
|
2264
|
+
if (log2.level > 0) {
|
|
2265
|
+
log2.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
2205
2266
|
}
|
|
2206
2267
|
} else if (!isSubOptions) {
|
|
2207
|
-
if (
|
|
2268
|
+
if (log2.level > 0) {
|
|
2208
2269
|
const suggestion = findSimilarOption(key, loaders);
|
|
2209
|
-
|
|
2270
|
+
log2.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
2210
2271
|
}
|
|
2211
2272
|
}
|
|
2212
2273
|
}
|
|
@@ -2236,16 +2297,20 @@ function normalizeOptionsInternal(loader, options, url) {
|
|
|
2236
2297
|
if (loaderDefaultOptions.core) {
|
|
2237
2298
|
mergedOptions.core = { ...loaderDefaultOptions.core };
|
|
2238
2299
|
}
|
|
2239
|
-
|
|
2300
|
+
const shapeKey = loader.defaultShape && getShapeOptionKey(loader);
|
|
2301
|
+
if (shapeKey) {
|
|
2302
|
+
mergedOptions[shapeKey] = {
|
|
2303
|
+
...loaderDefaultOptions[shapeKey],
|
|
2304
|
+
shape: loader.defaultShape
|
|
2305
|
+
};
|
|
2306
|
+
}
|
|
2307
|
+
mergeNestedFields(mergedOptions, getGlobalLoaderOptions());
|
|
2308
|
+
mergeNestedFields(mergedOptions, options);
|
|
2309
|
+
applyCoreShapeDefault(mergedOptions, options, loader);
|
|
2240
2310
|
if (((_a = mergedOptions.core) == null ? void 0 : _a.log) === null) {
|
|
2241
|
-
mergedOptions.core = { ...mergedOptions.core, log:
|
|
2311
|
+
mergedOptions.core = { ...mergedOptions.core, log: getLoaderLog(mergedOptions) };
|
|
2242
2312
|
}
|
|
2243
|
-
mergeNestedFields(mergedOptions, normalizeLoaderOptions(getGlobalLoaderOptions()));
|
|
2244
|
-
const userOptions = normalizeLoaderOptions(options);
|
|
2245
|
-
mergeNestedFields(mergedOptions, userOptions);
|
|
2246
|
-
applyCoreShapeDefault(mergedOptions, userOptions, loader);
|
|
2247
2313
|
addUrlOptions(mergedOptions, url);
|
|
2248
|
-
addDeprecatedTopLevelOptions(mergedOptions);
|
|
2249
2314
|
return mergedOptions;
|
|
2250
2315
|
}
|
|
2251
2316
|
function applyCoreShapeDefault(mergedOptions, userOptions, loader) {
|
|
@@ -2254,20 +2319,24 @@ function applyCoreShapeDefault(mergedOptions, userOptions, loader) {
|
|
|
2254
2319
|
if (coreShape === void 0) {
|
|
2255
2320
|
return;
|
|
2256
2321
|
}
|
|
2257
|
-
const
|
|
2322
|
+
const shapeOptionKey = getShapeOptionKey(loader);
|
|
2323
|
+
if (!shapeOptionKey) {
|
|
2324
|
+
return;
|
|
2325
|
+
}
|
|
2326
|
+
const loaderScopedDefaults = (_b = loader.options) == null ? void 0 : _b[shapeOptionKey];
|
|
2258
2327
|
if (!isPureObject(loaderScopedDefaults) || !("shape" in loaderScopedDefaults)) {
|
|
2259
2328
|
return;
|
|
2260
2329
|
}
|
|
2261
|
-
const globalLoaderScopedOptions = getGlobalLoaderOptions()[
|
|
2330
|
+
const globalLoaderScopedOptions = getGlobalLoaderOptions()[shapeOptionKey];
|
|
2262
2331
|
if (isPureObject(globalLoaderScopedOptions) && "shape" in globalLoaderScopedOptions) {
|
|
2263
2332
|
return;
|
|
2264
2333
|
}
|
|
2265
|
-
const userLoaderScopedOptions = userOptions[
|
|
2334
|
+
const userLoaderScopedOptions = userOptions[shapeOptionKey];
|
|
2266
2335
|
if (isPureObject(userLoaderScopedOptions) && "shape" in userLoaderScopedOptions) {
|
|
2267
2336
|
return;
|
|
2268
2337
|
}
|
|
2269
|
-
const loaderScopedOptions = mergedOptions[
|
|
2270
|
-
mergedOptions[
|
|
2338
|
+
const loaderScopedOptions = mergedOptions[shapeOptionKey];
|
|
2339
|
+
mergedOptions[shapeOptionKey] = {
|
|
2271
2340
|
...isPureObject(loaderScopedOptions) ? loaderScopedOptions : {},
|
|
2272
2341
|
shape: coreShape
|
|
2273
2342
|
};
|
|
@@ -2305,41 +2374,46 @@ function cloneLoaderOptions(options) {
|
|
|
2305
2374
|
}
|
|
2306
2375
|
return clonedOptions;
|
|
2307
2376
|
}
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2377
|
+
|
|
2378
|
+
// dist/lib/api/loader-options.js
|
|
2379
|
+
function compareLoaderOptions(left, right) {
|
|
2380
|
+
return Object.is(left, right) || compareOptionValues(left, right, /* @__PURE__ */ new WeakMap());
|
|
2381
|
+
}
|
|
2382
|
+
function compareOptionValues(left, right, visited) {
|
|
2383
|
+
if (Object.is(left, right)) {
|
|
2384
|
+
return true;
|
|
2314
2385
|
}
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
options.core ||= {};
|
|
2318
|
-
const coreOptions = options.core;
|
|
2319
|
-
const coreRecord = coreOptions;
|
|
2320
|
-
if (coreRecord[key] === void 0) {
|
|
2321
|
-
coreRecord[key] = options[key];
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2386
|
+
if (!left || !right || typeof left !== "object" || typeof right !== "object") {
|
|
2387
|
+
return false;
|
|
2324
2388
|
}
|
|
2325
|
-
const
|
|
2326
|
-
if (
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2389
|
+
const leftPrototype = Object.getPrototypeOf(left);
|
|
2390
|
+
if (leftPrototype !== Object.getPrototypeOf(right)) {
|
|
2391
|
+
return false;
|
|
2392
|
+
}
|
|
2393
|
+
if (Array.isArray(left)) {
|
|
2394
|
+
if (!Array.isArray(right) || left.length !== right.length) {
|
|
2395
|
+
return false;
|
|
2330
2396
|
}
|
|
2397
|
+
} else if (leftPrototype !== Object.prototype && leftPrototype !== null) {
|
|
2398
|
+
return false;
|
|
2331
2399
|
}
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
if (!coreOptions) {
|
|
2336
|
-
return;
|
|
2400
|
+
let rightValues = visited.get(left);
|
|
2401
|
+
if (rightValues == null ? void 0 : rightValues.has(right)) {
|
|
2402
|
+
return true;
|
|
2337
2403
|
}
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
}
|
|
2404
|
+
if (!rightValues) {
|
|
2405
|
+
rightValues = /* @__PURE__ */ new WeakSet();
|
|
2406
|
+
visited.set(left, rightValues);
|
|
2342
2407
|
}
|
|
2408
|
+
rightValues.add(right);
|
|
2409
|
+
const leftKeys = getEnumerableKeys(left);
|
|
2410
|
+
const rightKeys = getEnumerableKeys(right);
|
|
2411
|
+
const leftOptions = left;
|
|
2412
|
+
const rightOptions = right;
|
|
2413
|
+
return leftKeys.length === rightKeys.length && leftKeys.every((key) => Object.prototype.propertyIsEnumerable.call(right, key) && compareOptionValues(leftOptions[key], rightOptions[key], visited));
|
|
2414
|
+
}
|
|
2415
|
+
function getEnumerableKeys(value) {
|
|
2416
|
+
return Reflect.ownKeys(value).filter((key) => Object.prototype.propertyIsEnumerable.call(value, key));
|
|
2343
2417
|
}
|
|
2344
2418
|
|
|
2345
2419
|
// dist/lib/loader-utils/normalize-loader.js
|
|
@@ -2400,32 +2474,30 @@ function _unregisterLoaders() {
|
|
|
2400
2474
|
|
|
2401
2475
|
// dist/lib/api/select-loader.js
|
|
2402
2476
|
var EXT_PATTERN = /\.([^.]+)$/;
|
|
2403
|
-
async function selectLoader(data, loaders = [], options, context) {
|
|
2477
|
+
async function selectLoader(data, loaders = [], options, context, operation = "parse") {
|
|
2478
|
+
var _a, _b;
|
|
2404
2479
|
if (!validHTTPResponse(data)) {
|
|
2405
2480
|
return null;
|
|
2406
2481
|
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
if (data instanceof Response && mayContainText(data)) {
|
|
2410
|
-
const text = await data.clone().text();
|
|
2411
|
-
const textLoader = selectLoaderSync(text, loaders, { ...normalizedOptions, core: { ...normalizedOptions.core, nothrow: true } }, context);
|
|
2412
|
-
if (textLoader) {
|
|
2413
|
-
return textLoader;
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
let loader = selectLoaderSync(data, loaders, { ...normalizedOptions, core: { ...normalizedOptions.core, nothrow: true } }, context);
|
|
2417
|
-
if (loader) {
|
|
2418
|
-
return loader;
|
|
2482
|
+
if (loaders && !Array.isArray(loaders)) {
|
|
2483
|
+
return normalizeLoader(loaders);
|
|
2419
2484
|
}
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2485
|
+
const text = data instanceof Response && mayContainText(data) ? await data.clone().text() : null;
|
|
2486
|
+
let initialBytes;
|
|
2487
|
+
async function matchCandidates(candidates) {
|
|
2488
|
+
normalizeLoaders(candidates);
|
|
2489
|
+
const loader2 = text !== null && selectLoaderInternal(text, candidates, options, context, operation) || selectLoaderInternal(data, candidates, options, context, operation);
|
|
2490
|
+
if (!loader2 && isBlob(data) && candidates.length) {
|
|
2491
|
+
initialBytes ??= await data.slice(0, 10).arrayBuffer();
|
|
2492
|
+
return selectLoaderInternal(initialBytes, candidates, options, context, operation);
|
|
2493
|
+
}
|
|
2494
|
+
return loader2;
|
|
2423
2495
|
}
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
loader =
|
|
2496
|
+
let loader = await matchCandidates(loaders || []);
|
|
2497
|
+
if (!loader && !((_a = options == null ? void 0 : options.core) == null ? void 0 : _a.ignoreRegisteredLoaders)) {
|
|
2498
|
+
loader = await matchCandidates(getRegisteredLoaders());
|
|
2427
2499
|
}
|
|
2428
|
-
if (!loader && !
|
|
2500
|
+
if (!loader && !((_b = options == null ? void 0 : options.core) == null ? void 0 : _b.nothrow)) {
|
|
2429
2501
|
throw new Error(getNoValidLoaderMessage(data));
|
|
2430
2502
|
}
|
|
2431
2503
|
return loader;
|
|
@@ -2434,30 +2506,26 @@ function mayContainText(response) {
|
|
|
2434
2506
|
const mimeType = getResourceMIMEType(response);
|
|
2435
2507
|
return Boolean(mimeType && (mimeType.startsWith("text/") || mimeType === "application/json" || mimeType.endsWith("+json")));
|
|
2436
2508
|
}
|
|
2437
|
-
function selectLoaderSync(data, loaders = [], options, context) {
|
|
2509
|
+
function selectLoaderSync(data, loaders = [], options, context, operation = "parse") {
|
|
2510
|
+
var _a, _b;
|
|
2438
2511
|
if (!validHTTPResponse(data)) {
|
|
2439
2512
|
return null;
|
|
2440
2513
|
}
|
|
2441
|
-
const normalizedOptions = normalizeLoaderOptions(options || {});
|
|
2442
|
-
normalizedOptions.core ||= {};
|
|
2443
2514
|
if (loaders && !Array.isArray(loaders)) {
|
|
2444
2515
|
return normalizeLoader(loaders);
|
|
2445
2516
|
}
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
candidateLoaders.push(...getRegisteredLoaders());
|
|
2517
|
+
const candidates = loaders || [];
|
|
2518
|
+
normalizeLoaders(candidates);
|
|
2519
|
+
let loader = selectLoaderInternal(data, candidates, options, context, operation);
|
|
2520
|
+
if (!loader && !((_a = options == null ? void 0 : options.core) == null ? void 0 : _a.ignoreRegisteredLoaders)) {
|
|
2521
|
+
loader = selectLoaderInternal(data, getRegisteredLoaders(), options, context, operation);
|
|
2452
2522
|
}
|
|
2453
|
-
|
|
2454
|
-
const loader = selectLoaderInternal(data, candidateLoaders, normalizedOptions, context);
|
|
2455
|
-
if (!loader && !normalizedOptions.core.nothrow) {
|
|
2523
|
+
if (!loader && !((_b = options == null ? void 0 : options.core) == null ? void 0 : _b.nothrow)) {
|
|
2456
2524
|
throw new Error(getNoValidLoaderMessage(data));
|
|
2457
2525
|
}
|
|
2458
2526
|
return loader;
|
|
2459
2527
|
}
|
|
2460
|
-
function selectLoaderInternal(data, loaders, options, context) {
|
|
2528
|
+
function selectLoaderInternal(data, loaders, options, context, operation = "parse") {
|
|
2461
2529
|
var _a, _b, _c, _d, _e;
|
|
2462
2530
|
const url = getResourceUrl(data);
|
|
2463
2531
|
const type = getResourceMIMEType(data);
|
|
@@ -2473,20 +2541,27 @@ function selectLoaderInternal(data, loaders, options, context) {
|
|
|
2473
2541
|
loader = findLoaderByMIMEType(loaders, (_b = options == null ? void 0 : options.core) == null ? void 0 : _b.mimeType);
|
|
2474
2542
|
reason = `match forced by supplied MIME type ${(_c = options == null ? void 0 : options.core) == null ? void 0 : _c.mimeType}`;
|
|
2475
2543
|
}
|
|
2476
|
-
loader
|
|
2477
|
-
|
|
2478
|
-
|
|
2544
|
+
if (!loader && operation === "source") {
|
|
2545
|
+
loader = findSourceLoaderByTestURL(loaders, testUrl);
|
|
2546
|
+
reason = loader ? `matched source url ${testUrl}` : "";
|
|
2547
|
+
}
|
|
2548
|
+
const fallbackLoaders = operation === "source" && testUrl ? loaders.filter((candidate) => !candidate.testURL) : loaders;
|
|
2549
|
+
loader = loader || findLoaderByUrl(fallbackLoaders, testUrl);
|
|
2479
2550
|
reason = reason || (loader ? `matched url ${testUrl}` : "");
|
|
2480
|
-
loader
|
|
2551
|
+
if (!loader && operation === "parse") {
|
|
2552
|
+
loader = findSourceLoaderByTestURL(loaders, testUrl);
|
|
2553
|
+
reason = loader ? `matched source url ${testUrl}` : "";
|
|
2554
|
+
}
|
|
2555
|
+
loader = loader || findLoaderByMIMEType(fallbackLoaders, type);
|
|
2481
2556
|
reason = reason || (loader ? `matched MIME type ${type}` : "");
|
|
2482
|
-
loader = loader || findLoaderByInitialBytes(
|
|
2557
|
+
loader = loader || findLoaderByInitialBytes(fallbackLoaders, data);
|
|
2483
2558
|
reason = reason || (loader ? `matched initial data ${getFirstCharacters(data)}` : "");
|
|
2484
2559
|
if (!loader && isBlob(data)) {
|
|
2485
2560
|
loader = findSourceLoaderByTestData(loaders, data);
|
|
2486
2561
|
reason = reason || (loader ? "matched source testData" : "");
|
|
2487
2562
|
}
|
|
2488
2563
|
if ((_d = options == null ? void 0 : options.core) == null ? void 0 : _d.fallbackMimeType) {
|
|
2489
|
-
loader = loader || findLoaderByMIMEType(
|
|
2564
|
+
loader = loader || findLoaderByMIMEType(fallbackLoaders, (_e = options == null ? void 0 : options.core) == null ? void 0 : _e.fallbackMimeType);
|
|
2490
2565
|
reason = reason || (loader ? `matched fallback MIME type ${type}` : "");
|
|
2491
2566
|
}
|
|
2492
2567
|
if (reason) {
|
|
@@ -2536,18 +2611,19 @@ function findLoaderByExtension(loaders, extension) {
|
|
|
2536
2611
|
}
|
|
2537
2612
|
function findSourceLoaderByType(loaders, type) {
|
|
2538
2613
|
for (const loader of loaders) {
|
|
2539
|
-
if (
|
|
2614
|
+
if ((loader.type ?? loader.id) === type) {
|
|
2540
2615
|
return loader;
|
|
2541
2616
|
}
|
|
2542
2617
|
}
|
|
2543
2618
|
return null;
|
|
2544
2619
|
}
|
|
2545
2620
|
function findSourceLoaderByTestURL(loaders, url) {
|
|
2621
|
+
var _a;
|
|
2546
2622
|
if (!url) {
|
|
2547
2623
|
return null;
|
|
2548
2624
|
}
|
|
2549
2625
|
for (const loader of loaders) {
|
|
2550
|
-
if (
|
|
2626
|
+
if ((_a = loader.testURL) == null ? void 0 : _a.call(loader, url)) {
|
|
2551
2627
|
return loader;
|
|
2552
2628
|
}
|
|
2553
2629
|
}
|
|
@@ -2556,7 +2632,7 @@ function findSourceLoaderByTestURL(loaders, url) {
|
|
|
2556
2632
|
function findSourceLoaderByTestData(loaders, data) {
|
|
2557
2633
|
var _a;
|
|
2558
2634
|
for (const loader of loaders) {
|
|
2559
|
-
if (
|
|
2635
|
+
if (loader.testData) {
|
|
2560
2636
|
if ((_a = loader.testData) == null ? void 0 : _a.call(loader, data)) {
|
|
2561
2637
|
return loader;
|
|
2562
2638
|
}
|
|
@@ -2890,7 +2966,7 @@ function getFetchFunction(options, context) {
|
|
|
2890
2966
|
var _a, _b, _c;
|
|
2891
2967
|
const globalOptions = getGlobalLoaderOptions();
|
|
2892
2968
|
const loaderOptions = options || globalOptions;
|
|
2893
|
-
const fetchOption =
|
|
2969
|
+
const fetchOption = (_a = loaderOptions.core) == null ? void 0 : _a.fetch;
|
|
2894
2970
|
let fetchFunction;
|
|
2895
2971
|
if (typeof fetchOption === "function") {
|
|
2896
2972
|
fetchFunction = fetchOption;
|
|
@@ -2916,14 +2992,7 @@ var loaderImplementationPromises = /* @__PURE__ */ new Map();
|
|
|
2916
2992
|
var loaderImplementations = /* @__PURE__ */ new Map();
|
|
2917
2993
|
async function getLoaderImplementation(loader, options, url) {
|
|
2918
2994
|
var _a;
|
|
2919
|
-
if (
|
|
2920
|
-
const source = loader.preload ? await loader.preload(url || "", options) : loader;
|
|
2921
|
-
if (!isSourceLoader(source)) {
|
|
2922
|
-
throw new Error(`${loader.id} source loader preload() did not return a runtime source loader`);
|
|
2923
|
-
}
|
|
2924
|
-
return source;
|
|
2925
|
-
}
|
|
2926
|
-
if (isLoaderWithParser(loader)) {
|
|
2995
|
+
if (isLoaderWithParser(loader) || !loader.preload && loader.createDataSourceSync) {
|
|
2927
2996
|
return loader;
|
|
2928
2997
|
}
|
|
2929
2998
|
const implementationCacheKey = getLoaderImplementationCacheKey(loader, options);
|
|
@@ -2957,7 +3026,7 @@ async function getLoaderImplementation(loader, options, url) {
|
|
|
2957
3026
|
}
|
|
2958
3027
|
return await loaderImplementationPromise;
|
|
2959
3028
|
}
|
|
2960
|
-
function getLoaderImplementationSync(loader) {
|
|
3029
|
+
function getLoaderImplementationSync(loader, options) {
|
|
2961
3030
|
var _a;
|
|
2962
3031
|
if (loader.subloaders && !preparedLoaders.has(loader)) {
|
|
2963
3032
|
const prepared = preparedDefaults.get(loader);
|
|
@@ -2966,30 +3035,30 @@ function getLoaderImplementationSync(loader) {
|
|
|
2966
3035
|
if (!isLoaderWithParser(loader))
|
|
2967
3036
|
return null;
|
|
2968
3037
|
}
|
|
2969
|
-
if (isLoaderWithParser(loader)) {
|
|
3038
|
+
if (isLoaderWithParser(loader) || !loader.preload && loader.createDataSourceSync) {
|
|
2970
3039
|
return loader;
|
|
2971
3040
|
}
|
|
2972
|
-
const implementationCacheKey = getLoaderImplementationCacheKey(loader);
|
|
3041
|
+
const implementationCacheKey = getLoaderImplementationCacheKey(loader, options);
|
|
2973
3042
|
return ((_a = loaderImplementations.get(loader)) == null ? void 0 : _a.get(implementationCacheKey)) || null;
|
|
2974
3043
|
}
|
|
2975
3044
|
function isLoaderWithParser(loader) {
|
|
2976
3045
|
const candidate = loader;
|
|
2977
|
-
return Boolean(candidate.parse || candidate.parseSync || candidate.parseInBatches || candidate.parseText || candidate.parseTextSync || candidate.parseFile || candidate.parseFileInBatches);
|
|
3046
|
+
return Boolean(candidate.parse || candidate.parseBlob || candidate.parseUrl || candidate.parseSync || candidate.parseInBatches || candidate.parseText || candidate.parseTextSync || candidate.parseFile || candidate.parseFileInBatches);
|
|
2978
3047
|
}
|
|
2979
3048
|
async function resolveLoaderImplementation(loader, options, url) {
|
|
2980
3049
|
if (loader.preload) {
|
|
2981
3050
|
const preloadedLoader = await loader.preload(url || "", options);
|
|
2982
|
-
if (isLoaderWithParser(preloadedLoader)) {
|
|
3051
|
+
if (preloadedLoader && (isLoaderWithParser(preloadedLoader) || preloadedLoader.createDataSourceSync)) {
|
|
2983
3052
|
return preloadedLoader;
|
|
2984
3053
|
}
|
|
2985
|
-
throw new Error(`${loader.id} loader preload() did not return a parser-bearing loader`);
|
|
3054
|
+
throw new Error(`${loader.id} loader preload() did not return a parser-bearing loader or a source factory`);
|
|
2986
3055
|
}
|
|
2987
3056
|
const implementationSpecifier = getLoaderImplementationSpecifier(loader, options);
|
|
2988
3057
|
return await importLoaderImplementation(implementationSpecifier, loader.id);
|
|
2989
3058
|
}
|
|
2990
3059
|
function getLoaderImplementationSpecifier(loader, options) {
|
|
2991
3060
|
var _a;
|
|
2992
|
-
const workerType = (
|
|
3061
|
+
const workerType = (_a = options == null ? void 0 : options.core) == null ? void 0 : _a._workerType;
|
|
2993
3062
|
if (workerType === "test") {
|
|
2994
3063
|
const sourcePath = `modules/${loader.module}/src/${loader.id}-loader.ts`;
|
|
2995
3064
|
if (typeof window !== "undefined") {
|
|
@@ -3078,7 +3147,7 @@ async function bindSubloaders(loader, options, url) {
|
|
|
3078
3147
|
prepared.worker = false;
|
|
3079
3148
|
for (const method of [
|
|
3080
3149
|
"parseBlob",
|
|
3081
|
-
"
|
|
3150
|
+
"createDataSourceSync",
|
|
3082
3151
|
"parse",
|
|
3083
3152
|
"parseSync",
|
|
3084
3153
|
"parseText",
|
|
@@ -3126,9 +3195,6 @@ async function parseFile(file, loaders, options, context) {
|
|
|
3126
3195
|
if (!loader) {
|
|
3127
3196
|
return null;
|
|
3128
3197
|
}
|
|
3129
|
-
if (isSourceLoader(loader)) {
|
|
3130
|
-
throw new Error(`${loader.id} is a SourceLoader. Use load() to create a runtime source object instead of parseFile().`);
|
|
3131
|
-
}
|
|
3132
3198
|
const normalizedOptions = normalizeOptions(options, loader, candidateLoaders, url);
|
|
3133
3199
|
const authenticationLoader = !loader.getAuthentications && ((_c = (_b = normalizedOptions.core) == null ? void 0 : _b.credentials) == null ? void 0 : _c.length) ? await getLoaderImplementation(loader, normalizedOptions, url || (context == null ? void 0 : context.url)) : loader;
|
|
3134
3200
|
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url, normalizedOptions);
|
|
@@ -3138,16 +3204,18 @@ async function parseFile(file, loaders, options, context) {
|
|
|
3138
3204
|
strictOptions,
|
|
3139
3205
|
context || null
|
|
3140
3206
|
);
|
|
3141
|
-
return
|
|
3207
|
+
return parseFileWithLoader(loader, file, strictOptions, context);
|
|
3142
3208
|
}
|
|
3143
3209
|
async function parseFileWithLoader(loader, file, options, context) {
|
|
3144
|
-
var _a;
|
|
3210
|
+
var _a, _b;
|
|
3145
3211
|
(_a = options.signal || context.signal) == null ? void 0 : _a.throwIfAborted();
|
|
3146
3212
|
validateWorkerVersion(loader);
|
|
3147
3213
|
options = mergeOptions(loader.options, options);
|
|
3148
3214
|
const loaderWithParser = await getLoaderImplementation(loader, options, context.url);
|
|
3149
3215
|
if (loaderWithParser.parseFile) {
|
|
3150
|
-
|
|
3216
|
+
const output = (_b = loaderWithParser.prepareParseOutput) == null ? void 0 : _b.call(loaderWithParser, options);
|
|
3217
|
+
const result = await loaderWithParser.parseFile(file, (output == null ? void 0 : output.options) ?? options, context);
|
|
3218
|
+
return output ? output.convert(result) : result;
|
|
3151
3219
|
}
|
|
3152
3220
|
const parseFunction = loaderWithParser.parse;
|
|
3153
3221
|
if (parseFunction) {
|
|
@@ -3158,6 +3226,9 @@ async function parseFileWithLoader(loader, file, options, context) {
|
|
|
3158
3226
|
const data = await file.read(0n, length);
|
|
3159
3227
|
return await parse(data, loaderWithParser, options, context);
|
|
3160
3228
|
}
|
|
3229
|
+
if (loaderWithParser.createDataSourceSync) {
|
|
3230
|
+
throw new Error(`${loader.id} has no file parser. Use createDataSource() to open a source.`);
|
|
3231
|
+
}
|
|
3161
3232
|
throw new Error(`${loader.id} loader - no file parser found`);
|
|
3162
3233
|
}
|
|
3163
3234
|
|
|
@@ -3175,9 +3246,6 @@ function parseSync(data, loaders, options, context) {
|
|
|
3175
3246
|
if (!loader) {
|
|
3176
3247
|
return null;
|
|
3177
3248
|
}
|
|
3178
|
-
if (isSourceLoader(loader)) {
|
|
3179
|
-
throw new Error(`${loader.id} is a SourceLoader. Use load() to create a runtime source object instead of parseSync().`);
|
|
3180
|
-
}
|
|
3181
3249
|
const strictOptions = normalizeOptions(options, loader, candidateLoaders);
|
|
3182
3250
|
const url = getResourceUrl(data);
|
|
3183
3251
|
const parse2 = () => {
|
|
@@ -3198,6 +3266,9 @@ function parseWithLoaderSync(loader, data, options, context) {
|
|
|
3198
3266
|
if (loader.preload) {
|
|
3199
3267
|
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 || ""}`);
|
|
3200
3268
|
}
|
|
3269
|
+
if (loader.createDataSourceSync) {
|
|
3270
|
+
throw new Error(`${loader.id} has no synchronous parser. Use createDataSource() to open a source.`);
|
|
3271
|
+
}
|
|
3201
3272
|
throw new Error(`${loader.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${context.url || ""}`);
|
|
3202
3273
|
}
|
|
3203
3274
|
|
|
@@ -3222,14 +3293,29 @@ async function parseInBatches(data, loaders, options, context) {
|
|
|
3222
3293
|
const normalizedOptions = normalizeOptions(options, loader, loaderArray, url);
|
|
3223
3294
|
const authenticationLoader = !loader.getAuthentications && ((_d = (_c = normalizedOptions.core) == null ? void 0 : _c.credentials) == null ? void 0 : _d.length) ? await getLoaderImplementation(loader, normalizedOptions, url || (context == null ? void 0 : context.url)) : loader;
|
|
3224
3295
|
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url || "", normalizedOptions);
|
|
3296
|
+
const nativeArrow = usesNativeArrowBatches(loader, strictOptions);
|
|
3225
3297
|
context = getLoaderContext({ url, _parseInBatches: parseInBatches, _parse: parse, loaders: loaderArray }, strictOptions, context || null);
|
|
3226
3298
|
const loaderWithParser = await getLoaderImplementation(loader, strictOptions, context.url);
|
|
3227
|
-
|
|
3299
|
+
const batches = await parseWithLoaderInBatches(loader, loaderWithParser, data, strictOptions, context);
|
|
3300
|
+
return nativeArrow ? normalizeNativeArrowBatches(batches) : batches;
|
|
3228
3301
|
}
|
|
3229
3302
|
async function parseWithLoaderInBatches(originalLoader, loader, data, options, context) {
|
|
3230
|
-
var _a;
|
|
3231
|
-
const
|
|
3232
|
-
|
|
3303
|
+
var _a, _b;
|
|
3304
|
+
const { batchMaxRowsPerSecond = 0, batchSize } = options.core ?? {};
|
|
3305
|
+
validateBatchDeliveryRate(batchMaxRowsPerSecond);
|
|
3306
|
+
if (batchSize !== void 0 && batchSize !== "auto" && (!Number.isSafeInteger(batchSize) || batchSize < 1)) {
|
|
3307
|
+
throw new RangeError('core.batchSize must be a positive integer or "auto"');
|
|
3308
|
+
}
|
|
3309
|
+
const parserOptions = batchMaxRowsPerSecond ? { ...options, core: { ...options.core, batchMaxRowsPerSecond: 0 } } : options;
|
|
3310
|
+
const output = loader.parseInBatches ? (_a = loader.prepareParseBatchOutput) == null ? void 0 : _a.call(loader, parserOptions) : null;
|
|
3311
|
+
const decoded = await parseToOutputIterator(loader, data, (output == null ? void 0 : output.options) ?? parserOptions, context);
|
|
3312
|
+
const batches = output ? convertOutputBatches(decoded, output.convert) : decoded;
|
|
3313
|
+
const outputIterator = batchMaxRowsPerSecond ? paceBatchIterator(batches, {
|
|
3314
|
+
batchMaxRowsPerSecond,
|
|
3315
|
+
getRowCount: (batch) => getBatchRowCount(batch, loader.module),
|
|
3316
|
+
signal: options.signal ?? context.signal
|
|
3317
|
+
}) : batches;
|
|
3318
|
+
if (!((_b = options == null ? void 0 : options.core) == null ? void 0 : _b.metadata)) {
|
|
3233
3319
|
return outputIterator;
|
|
3234
3320
|
}
|
|
3235
3321
|
const metadataBatch = {
|
|
@@ -3249,6 +3335,11 @@ async function parseWithLoaderInBatches(originalLoader, loader, data, options, c
|
|
|
3249
3335
|
}
|
|
3250
3336
|
return makeMetadataBatchIterator(outputIterator);
|
|
3251
3337
|
}
|
|
3338
|
+
async function* convertOutputBatches(batches, convert) {
|
|
3339
|
+
for await (const batch of batches) {
|
|
3340
|
+
yield convert(batch);
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3252
3343
|
async function parseToOutputIterator(loader, data, options, context) {
|
|
3253
3344
|
var _a;
|
|
3254
3345
|
const inputIterator = await getAsyncIterableFromData(data, options);
|
|
@@ -3270,6 +3361,10 @@ async function* parseChunkInBatches(transformedIterator, loader, options, contex
|
|
|
3270
3361
|
{ ...options, core: { ...options == null ? void 0 : options.core, mimeType: loader.mimeTypes[0] } },
|
|
3271
3362
|
context
|
|
3272
3363
|
);
|
|
3364
|
+
if (isArrowTable(parsedData)) {
|
|
3365
|
+
yield* parsedData.batches;
|
|
3366
|
+
return;
|
|
3367
|
+
}
|
|
3273
3368
|
const batch = convertDataToBatch(parsedData, loader);
|
|
3274
3369
|
yield batch;
|
|
3275
3370
|
}
|
|
@@ -3296,8 +3391,6 @@ function isTable(value) {
|
|
|
3296
3391
|
return Array.isArray(table.features);
|
|
3297
3392
|
case "columnar-table":
|
|
3298
3393
|
return Boolean(table.data && typeof table.data === "object");
|
|
3299
|
-
case "arrow-table":
|
|
3300
|
-
return Boolean(table.data && typeof table.data === "object" && "numRows" in table.data);
|
|
3301
3394
|
default:
|
|
3302
3395
|
return false;
|
|
3303
3396
|
}
|
|
@@ -3309,8 +3402,6 @@ function getTableLength(table) {
|
|
|
3309
3402
|
return table.data.length;
|
|
3310
3403
|
case "geojson-table":
|
|
3311
3404
|
return table.features.length;
|
|
3312
|
-
case "arrow-table":
|
|
3313
|
-
return table.data.numRows;
|
|
3314
3405
|
case "columnar-table":
|
|
3315
3406
|
for (const column of Object.values(table.data)) {
|
|
3316
3407
|
return column.length || 0;
|
|
@@ -3325,38 +3416,21 @@ async function applyInputTransforms(inputIterator, transforms = []) {
|
|
|
3325
3416
|
}
|
|
3326
3417
|
return iteratorChain;
|
|
3327
3418
|
}
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
if (
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
return promises;
|
|
3344
|
-
}
|
|
3345
|
-
async function loadOneFileInBatches(file, loaders, options) {
|
|
3346
|
-
var _a, _b;
|
|
3347
|
-
if (typeof file === "string") {
|
|
3348
|
-
const url = file;
|
|
3349
|
-
const loader = await selectLoader(url, loaders, {
|
|
3350
|
-
...options,
|
|
3351
|
-
core: { ...options.core, nothrow: true }
|
|
3352
|
-
});
|
|
3353
|
-
const authenticationLoader = loader && !loader.getAuthentications && ((_b = (_a = options.core) == null ? void 0 : _a.credentials) == null ? void 0 : _b.length) ? await getLoaderImplementation(loader, options, url) : loader;
|
|
3354
|
-
options = await resolveLoaderAuthenticationOptions(authenticationLoader, url, options);
|
|
3355
|
-
const fetch2 = getFetchFunction(options);
|
|
3356
|
-
const response = await fetch2(applySearchParamsToUrl(url, options));
|
|
3357
|
-
return Array.isArray(loaders) ? await parseInBatches(response, loaders, options) : await parseInBatches(response, loaders, options);
|
|
3358
|
-
}
|
|
3359
|
-
return Array.isArray(loaders) ? await parseInBatches(file, loaders, options) : await parseInBatches(file, loaders, options);
|
|
3419
|
+
function getBatchRowCount(batch, module2) {
|
|
3420
|
+
var _a, _b, _c;
|
|
3421
|
+
if (!batch || typeof batch !== "object")
|
|
3422
|
+
return void 0;
|
|
3423
|
+
if (module2 === "geospatial" && Array.isArray(batch))
|
|
3424
|
+
return batch.length;
|
|
3425
|
+
const result = batch;
|
|
3426
|
+
if (module2 === "traces" && result.table !== void 0 && result.table !== "spans" && result.table !== "slices") {
|
|
3427
|
+
return void 0;
|
|
3428
|
+
}
|
|
3429
|
+
if (result.batchType !== void 0 && result.batchType !== "data")
|
|
3430
|
+
return void 0;
|
|
3431
|
+
if (result.shape === "unknown")
|
|
3432
|
+
return void 0;
|
|
3433
|
+
return ((_a = result.data) == null ? void 0 : _a.numRows) ?? result.numRows ?? ((_b = result.header) == null ? void 0 : _b.vertexCount) ?? ((_c = result.features) == null ? void 0 : _c.length) ?? result.length;
|
|
3360
3434
|
}
|
|
3361
3435
|
|
|
3362
3436
|
// dist/lib/api/load.js
|
|
@@ -3373,59 +3447,22 @@ async function load(url, loaders, options, context) {
|
|
|
3373
3447
|
resolvedOptions = options;
|
|
3374
3448
|
}
|
|
3375
3449
|
resolvedOptions ||= getGlobalLoaderOptions();
|
|
3376
|
-
if (!Array.isArray(resolvedLoaders) && isSourceLoader(resolvedLoaders)) {
|
|
3377
|
-
const sourceLoader = await resolveSourceLoader(resolvedLoaders, url, resolvedOptions);
|
|
3378
|
-
resolvedOptions = await resolveLoaderAuthenticationOptions(resolvedLoaders.getAuthentications ? resolvedLoaders : sourceLoader, typeof url === "string" ? url : "", resolvedOptions || {});
|
|
3379
|
-
const runtimeCoreApi = {
|
|
3380
|
-
fetchFile,
|
|
3381
|
-
parse,
|
|
3382
|
-
parseFile,
|
|
3383
|
-
parseSync,
|
|
3384
|
-
parseInBatches,
|
|
3385
|
-
load,
|
|
3386
|
-
loadInBatches
|
|
3387
|
-
};
|
|
3388
|
-
return sourceLoader.createDataSource(url, resolvedOptions || {}, runtimeCoreApi);
|
|
3389
|
-
}
|
|
3390
|
-
if (Array.isArray(resolvedLoaders) && resolvedLoaders.length === 1 && isSourceLoader(resolvedLoaders[0])) {
|
|
3391
|
-
const sourceLoader = await resolveSourceLoader(resolvedLoaders[0], url, resolvedOptions);
|
|
3392
|
-
resolvedOptions = await resolveLoaderAuthenticationOptions(resolvedLoaders[0].getAuthentications ? resolvedLoaders[0] : sourceLoader, typeof url === "string" ? url : "", resolvedOptions || {});
|
|
3393
|
-
const runtimeCoreApi = {
|
|
3394
|
-
fetchFile,
|
|
3395
|
-
parse,
|
|
3396
|
-
parseFile,
|
|
3397
|
-
parseSync,
|
|
3398
|
-
parseInBatches,
|
|
3399
|
-
load,
|
|
3400
|
-
loadInBatches
|
|
3401
|
-
};
|
|
3402
|
-
return sourceLoader.createDataSource(url, resolvedOptions || {}, runtimeCoreApi);
|
|
3403
|
-
}
|
|
3404
3450
|
if (typeof url === "string" || isBlob(url)) {
|
|
3405
3451
|
const selectedLoader = await selectLoader(url, resolvedLoaders, {
|
|
3406
3452
|
...resolvedOptions,
|
|
3407
3453
|
core: { ...resolvedOptions == null ? void 0 : resolvedOptions.core, nothrow: true }
|
|
3408
3454
|
});
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
return sourceLoader.createDataSource(url, resolvedOptions || {}, {
|
|
3413
|
-
fetchFile,
|
|
3414
|
-
parse,
|
|
3415
|
-
parseFile,
|
|
3416
|
-
parseSync,
|
|
3417
|
-
parseInBatches,
|
|
3418
|
-
load,
|
|
3419
|
-
loadInBatches
|
|
3420
|
-
});
|
|
3455
|
+
const loaderImplementation = selectedLoader && (typeof url === "string" || selectedLoader.createDataSourceSync) ? await getLoaderImplementation(selectedLoader, resolvedOptions, typeof url === "string" ? url : void 0) : null;
|
|
3456
|
+
if (selectedLoader && (loaderImplementation == null ? void 0 : loaderImplementation.createDataSourceSync) && !isLoaderWithParser(loaderImplementation)) {
|
|
3457
|
+
throw new Error(`${selectedLoader.id} creates sources. Use createDataSource() instead of load().`);
|
|
3421
3458
|
}
|
|
3422
|
-
if (selectedLoader && typeof url === "string") {
|
|
3423
|
-
const loaderImplementation = await getLoaderImplementation(selectedLoader, resolvedOptions, url);
|
|
3459
|
+
if (selectedLoader && loaderImplementation && typeof url === "string") {
|
|
3424
3460
|
resolvedOptions = await resolveLoaderAuthenticationOptions(selectedLoader.getAuthentications ? selectedLoader : loaderImplementation, url, resolvedOptions || {});
|
|
3425
|
-
const parseUrl = loaderImplementation
|
|
3461
|
+
const { parseUrl } = loaderImplementation;
|
|
3426
3462
|
if (parseUrl) {
|
|
3427
3463
|
const requestUrl = applySearchParamsToUrl(url, resolvedOptions);
|
|
3428
|
-
|
|
3464
|
+
const options2 = normalizeOptions(resolvedOptions, selectedLoader, [selectedLoader], url);
|
|
3465
|
+
return parseUrl(requestUrl, options2, context);
|
|
3429
3466
|
}
|
|
3430
3467
|
}
|
|
3431
3468
|
}
|
|
@@ -3440,8 +3477,7 @@ async function load(url, loaders, options, context) {
|
|
|
3440
3477
|
data = await fetch2(url);
|
|
3441
3478
|
}
|
|
3442
3479
|
if (typeof url === "string") {
|
|
3443
|
-
|
|
3444
|
-
if (!((_a = normalizedOptions.core) == null ? void 0 : _a.baseUrl)) {
|
|
3480
|
+
if (!((_a = resolvedOptions == null ? void 0 : resolvedOptions.core) == null ? void 0 : _a.baseUrl)) {
|
|
3445
3481
|
resolvedOptions = {
|
|
3446
3482
|
...resolvedOptions,
|
|
3447
3483
|
core: {
|
|
@@ -3453,15 +3489,38 @@ async function load(url, loaders, options, context) {
|
|
|
3453
3489
|
}
|
|
3454
3490
|
return Array.isArray(resolvedLoaders) ? await parse(data, resolvedLoaders, resolvedOptions, context) : await parse(data, resolvedLoaders, resolvedOptions, context);
|
|
3455
3491
|
}
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3492
|
+
|
|
3493
|
+
// dist/lib/api/load-in-batches.js
|
|
3494
|
+
function loadInBatches(files, loaders, options, context) {
|
|
3495
|
+
let loadersArray;
|
|
3496
|
+
if (!Array.isArray(loaders) && !isLoaderObject(loaders)) {
|
|
3497
|
+
context = void 0;
|
|
3498
|
+
options = loaders;
|
|
3499
|
+
loadersArray = void 0;
|
|
3500
|
+
} else {
|
|
3501
|
+
loadersArray = loaders;
|
|
3502
|
+
}
|
|
3503
|
+
if (!Array.isArray(files)) {
|
|
3504
|
+
return loadOneFileInBatches(files, loadersArray, options || {});
|
|
3459
3505
|
}
|
|
3460
|
-
const
|
|
3461
|
-
|
|
3462
|
-
|
|
3506
|
+
const promises = files.map((file) => loadOneFileInBatches(file, loadersArray, options || {}));
|
|
3507
|
+
return promises;
|
|
3508
|
+
}
|
|
3509
|
+
async function loadOneFileInBatches(file, loaders, options) {
|
|
3510
|
+
var _a, _b;
|
|
3511
|
+
if (typeof file === "string") {
|
|
3512
|
+
const url = file;
|
|
3513
|
+
const loader = await selectLoader(url, loaders, {
|
|
3514
|
+
...options,
|
|
3515
|
+
core: { ...options.core, nothrow: true }
|
|
3516
|
+
});
|
|
3517
|
+
const authenticationLoader = loader && !loader.getAuthentications && ((_b = (_a = options.core) == null ? void 0 : _a.credentials) == null ? void 0 : _b.length) ? await getLoaderImplementation(loader, options, url) : loader;
|
|
3518
|
+
options = await resolveLoaderAuthenticationOptions(authenticationLoader, url, options);
|
|
3519
|
+
const fetch2 = getFetchFunction(options);
|
|
3520
|
+
const response = await fetch2(applySearchParamsToUrl(url, options));
|
|
3521
|
+
return Array.isArray(loaders) ? await parseInBatches(response, loaders, options) : await parseInBatches(response, loaders, options);
|
|
3463
3522
|
}
|
|
3464
|
-
return
|
|
3523
|
+
return Array.isArray(loaders) ? await parseInBatches(file, loaders, options) : await parseInBatches(file, loaders, options);
|
|
3465
3524
|
}
|
|
3466
3525
|
|
|
3467
3526
|
// dist/lib/api/core-api.js
|
|
@@ -3540,9 +3599,6 @@ async function parse(data, loaders, options, context) {
|
|
|
3540
3599
|
if (!loader) {
|
|
3541
3600
|
return null;
|
|
3542
3601
|
}
|
|
3543
|
-
if (isSourceLoader(loader)) {
|
|
3544
|
-
throw new Error(`${loader.id} is a SourceLoader. Use load() to create a runtime source object instead of parse().`);
|
|
3545
|
-
}
|
|
3546
3602
|
const normalizedOptions = normalizeOptions(options, loader, candidateLoaders, url);
|
|
3547
3603
|
const authenticationLoader = !loader.getAuthentications && ((_d = (_c = normalizedOptions.core) == null ? void 0 : _c.credentials) == null ? void 0 : _d.length) ? await getLoaderImplementation(loader, normalizedOptions, url || (context == null ? void 0 : context.url)) : loader;
|
|
3548
3604
|
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url || "", normalizedOptions);
|
|
@@ -3552,10 +3608,10 @@ async function parse(data, loaders, options, context) {
|
|
|
3552
3608
|
strictOptions,
|
|
3553
3609
|
context || null
|
|
3554
3610
|
);
|
|
3555
|
-
return
|
|
3611
|
+
return parseWithLoader(loader, data, strictOptions, context);
|
|
3556
3612
|
}
|
|
3557
3613
|
async function parseWithLoader(loader, data, options, context) {
|
|
3558
|
-
var _a;
|
|
3614
|
+
var _a, _b;
|
|
3559
3615
|
(_a = options.signal || context.signal) == null ? void 0 : _a.throwIfAborted();
|
|
3560
3616
|
validateWorkerVersion(loader);
|
|
3561
3617
|
options = mergeOptions(loader.options, options);
|
|
@@ -3565,15 +3621,22 @@ async function parseWithLoader(loader, data, options, context) {
|
|
|
3565
3621
|
context.response = { headers, ok, redirected, status, statusText, type, url };
|
|
3566
3622
|
}
|
|
3567
3623
|
const loaderWithParser = await getLoaderImplementation(loader, options, context.url);
|
|
3568
|
-
if (
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3624
|
+
if (loaderWithParser.createDataSourceSync && !isLoaderWithParser(loaderWithParser)) {
|
|
3625
|
+
throw new Error(`${loader.id} creates sources. Use createDataSource() to open a source.`);
|
|
3626
|
+
}
|
|
3627
|
+
const output = (_b = loaderWithParser.prepareParseOutput) == null ? void 0 : _b.call(loaderWithParser, options);
|
|
3628
|
+
const parseOptions = (output == null ? void 0 : output.options) ?? options;
|
|
3629
|
+
let result;
|
|
3630
|
+
if (shouldParseWithWorker(loaderWithParser, data, parseOptions, context, loader)) {
|
|
3631
|
+
data = await getArrayBufferFromData(data, parseOptions);
|
|
3632
|
+
result = await parseWithWorker(loaderWithParser, data, parseOptions, context, parse);
|
|
3633
|
+
} else if (isBlob(data) && loaderWithParser.parseBlob) {
|
|
3634
|
+
result = await loaderWithParser.parseBlob(data, parseOptions, context);
|
|
3635
|
+
} else {
|
|
3636
|
+
data = await getArrayBufferOrStringFromData(data, loader, parseOptions);
|
|
3637
|
+
result = await parseWithLoaderImplementation(loaderWithParser, data, parseOptions, context);
|
|
3574
3638
|
}
|
|
3575
|
-
|
|
3576
|
-
return await parseWithLoaderImplementation(loaderWithParser, data, options, context);
|
|
3639
|
+
return output ? output.convert(result) : result;
|
|
3577
3640
|
}
|
|
3578
3641
|
async function parseWithLoaderImplementation(loader, data, options, context) {
|
|
3579
3642
|
if (loader.parseText && typeof data === "string") {
|
|
@@ -3588,6 +3651,9 @@ async function parseWithLoaderImplementation(loader, data, options, context) {
|
|
|
3588
3651
|
if (loader.parseSync) {
|
|
3589
3652
|
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 || ""}`);
|
|
3590
3653
|
}
|
|
3654
|
+
if (loader.createDataSourceSync) {
|
|
3655
|
+
throw new Error(`${loader.id} creates sources. Use createDataSource() to open a source.`);
|
|
3656
|
+
}
|
|
3591
3657
|
throw new Error(`${loader.id} loader - no parser found and worker is disabled`);
|
|
3592
3658
|
}
|
|
3593
3659
|
|
|
@@ -3686,8 +3752,15 @@ function encodeTextSync(data, writer, options) {
|
|
|
3686
3752
|
}
|
|
3687
3753
|
function encodeInBatches(data, writer, options) {
|
|
3688
3754
|
if (writer.encodeInBatches) {
|
|
3689
|
-
|
|
3690
|
-
|
|
3755
|
+
let dataIterator;
|
|
3756
|
+
if (data && typeof data === "object") {
|
|
3757
|
+
if ("numRows" in data && "schema" in data) {
|
|
3758
|
+
dataIterator = [data];
|
|
3759
|
+
} else if (Symbol.iterator in data || Symbol.asyncIterator in data) {
|
|
3760
|
+
dataIterator = data;
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
return writer.encodeInBatches(dataIterator ?? getIterator2(data), options);
|
|
3691
3764
|
}
|
|
3692
3765
|
throw new Error(`Writer ${writer.name} could not encode in batches`);
|
|
3693
3766
|
}
|
|
@@ -3721,44 +3794,62 @@ function getTemporaryFilename(filename2) {
|
|
|
3721
3794
|
}
|
|
3722
3795
|
|
|
3723
3796
|
// dist/lib/api/create-data-source.js
|
|
3724
|
-
function createDataSource(data,
|
|
3725
|
-
var _a, _b, _c
|
|
3726
|
-
|
|
3727
|
-
const
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3797
|
+
async function createDataSource(data, loaders, options = {}) {
|
|
3798
|
+
var _a, _b, _c;
|
|
3799
|
+
(_a = options.signal) == null ? void 0 : _a.throwIfAborted();
|
|
3800
|
+
const candidates = getCandidates(loaders, options);
|
|
3801
|
+
const loader = candidates.length === 1 ? candidates[0] : await selectLoader(data, candidates, getSelectionOptions(options), void 0, "source");
|
|
3802
|
+
if (!loader) {
|
|
3803
|
+
throw new Error("No explicit source loader matches the input");
|
|
3804
|
+
}
|
|
3805
|
+
const url = typeof data === "string" ? data : "";
|
|
3806
|
+
const implementation = await preload(loader, options, url);
|
|
3807
|
+
(_b = options.signal) == null ? void 0 : _b.throwIfAborted();
|
|
3808
|
+
const authenticatedOptions = await resolveLoaderAuthenticationOptions(loader.getAuthentications ? loader : implementation, url, options);
|
|
3809
|
+
(_c = options.signal) == null ? void 0 : _c.throwIfAborted();
|
|
3810
|
+
return constructSource(implementation, data, authenticatedOptions);
|
|
3811
|
+
}
|
|
3812
|
+
function createDataSourceSync(data, loaders, options = {}) {
|
|
3813
|
+
var _a, _b, _c, _d;
|
|
3814
|
+
const candidates = getCandidates(loaders, options);
|
|
3815
|
+
const loader = candidates.length === 1 ? candidates[0] : selectLoaderSync(data, candidates, getSelectionOptions(options), void 0, "source");
|
|
3816
|
+
if (!loader) {
|
|
3817
|
+
throw new Error("No explicit source loader matches the input");
|
|
3818
|
+
}
|
|
3819
|
+
const implementation = getLoaderImplementationSync(loader, options);
|
|
3820
|
+
if (!implementation) {
|
|
3821
|
+
throw new Error(`${loader.id} has no synchronous source factory available. Call preload() first.`);
|
|
3822
|
+
}
|
|
3823
|
+
const authenticationLoader = loader.getAuthentications ? loader : implementation;
|
|
3824
|
+
const contributions = ((_b = (_a = options.core) == null ? void 0 : _a.credentials) == null ? void 0 : _b.length) ? (_c = authenticationLoader.getAuthentications) == null ? void 0 : _c.call(authenticationLoader, typeof data === "string" ? data : "", options) : void 0;
|
|
3738
3825
|
if (contributions && "then" in contributions) {
|
|
3739
3826
|
void contributions.catch(() => {
|
|
3740
3827
|
});
|
|
3741
|
-
throw new Error("Use
|
|
3828
|
+
throw new Error("Use createDataSource() with an asynchronous getAuthentications() hook.");
|
|
3742
3829
|
}
|
|
3743
3830
|
const authenticatedOptions = resolveAuthenticationOptions((contributions == null ? void 0 : contributions.length) ? {
|
|
3744
|
-
...
|
|
3831
|
+
...options,
|
|
3745
3832
|
core: {
|
|
3746
|
-
...
|
|
3747
|
-
authentications: [
|
|
3748
|
-
...((_e = resolvedOptions.core) == null ? void 0 : _e.authentications) || [],
|
|
3749
|
-
...contributions || []
|
|
3750
|
-
]
|
|
3833
|
+
...options.core,
|
|
3834
|
+
authentications: [...((_d = options.core) == null ? void 0 : _d.authentications) || [], ...contributions]
|
|
3751
3835
|
}
|
|
3752
|
-
} :
|
|
3753
|
-
return
|
|
3836
|
+
} : options);
|
|
3837
|
+
return constructSource(implementation, data, authenticatedOptions);
|
|
3754
3838
|
}
|
|
3755
|
-
function
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3839
|
+
function getCandidates(loaders, options) {
|
|
3840
|
+
var _a;
|
|
3841
|
+
const candidates = Array.isArray(loaders) ? [...loaders] : [loaders];
|
|
3842
|
+
const type = ((_a = options.core) == null ? void 0 : _a.type) || options.type;
|
|
3843
|
+
return candidates.length > 1 && type && type !== "auto" ? candidates.filter((loader) => (loader.type ?? loader.id) === type) : candidates;
|
|
3844
|
+
}
|
|
3845
|
+
function getSelectionOptions(options) {
|
|
3846
|
+
return { ...options, core: { ...options.core, ignoreRegisteredLoaders: true, nothrow: true } };
|
|
3847
|
+
}
|
|
3848
|
+
function constructSource(loader, data, options) {
|
|
3849
|
+
if (loader.createDataSourceSync) {
|
|
3850
|
+
return loader.createDataSourceSync(data, options, coreApi);
|
|
3760
3851
|
}
|
|
3761
|
-
|
|
3852
|
+
throw new Error(`${loader.id} has no synchronous source factory. Use createDataSource() to preload the loader.`);
|
|
3762
3853
|
}
|
|
3763
3854
|
|
|
3764
3855
|
// dist/lib/api/select-source.js
|
|
@@ -3766,16 +3857,16 @@ function selectSource(url, sources, options) {
|
|
|
3766
3857
|
const type = (options == null ? void 0 : options.type) || "auto";
|
|
3767
3858
|
let selectedSource = null;
|
|
3768
3859
|
if (type === "auto") {
|
|
3769
|
-
selectedSource = selectLoaderSync(url, sources, { core: { nothrow: true } });
|
|
3860
|
+
selectedSource = selectLoaderSync(url, sources, { core: { nothrow: true } }, void 0, "source");
|
|
3770
3861
|
} else {
|
|
3771
|
-
selectedSource =
|
|
3862
|
+
selectedSource = getSourceOfType(type, sources);
|
|
3772
3863
|
}
|
|
3773
3864
|
if (!selectedSource && !(options == null ? void 0 : options.nothrow)) {
|
|
3774
3865
|
throw new Error("Not a valid image source type");
|
|
3775
3866
|
}
|
|
3776
3867
|
return selectedSource;
|
|
3777
3868
|
}
|
|
3778
|
-
function
|
|
3869
|
+
function getSourceOfType(type, sources) {
|
|
3779
3870
|
for (const service of sources) {
|
|
3780
3871
|
if (service.type === type) {
|
|
3781
3872
|
return service;
|
|
@@ -3824,29 +3915,14 @@ function makeStream(source, options) {
|
|
|
3824
3915
|
}
|
|
3825
3916
|
|
|
3826
3917
|
// dist/null-loader.js
|
|
3827
|
-
var
|
|
3828
|
-
var NullWorkerLoader = {
|
|
3829
|
-
dataType: null,
|
|
3830
|
-
batchType: null,
|
|
3831
|
-
name: "Null loader",
|
|
3832
|
-
id: "null",
|
|
3833
|
-
module: "core",
|
|
3834
|
-
version: VERSION4,
|
|
3835
|
-
worker: true,
|
|
3836
|
-
mimeTypes: ["application/x.empty"],
|
|
3837
|
-
extensions: ["null"],
|
|
3838
|
-
tests: [() => false],
|
|
3839
|
-
options: {
|
|
3840
|
-
null: {}
|
|
3841
|
-
}
|
|
3842
|
-
};
|
|
3918
|
+
var VERSION5 = true ? "5.0.0-rc.1" : "latest";
|
|
3843
3919
|
var NullLoader = {
|
|
3844
3920
|
dataType: null,
|
|
3845
3921
|
batchType: null,
|
|
3846
3922
|
name: "Null loader",
|
|
3847
3923
|
id: "null",
|
|
3848
3924
|
module: "core",
|
|
3849
|
-
version:
|
|
3925
|
+
version: VERSION5,
|
|
3850
3926
|
mimeTypes: ["application/x.empty"],
|
|
3851
3927
|
extensions: ["null"],
|
|
3852
3928
|
parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options || {}, context),
|