@loaders.gl/core 4.0.0-alpha.9 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +172 -175
- package/dist/es5/index.js +10 -5
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/es5/javascript-utils/is-type.js +1 -1
- package/dist/es5/javascript-utils/is-type.js.map +1 -1
- package/dist/es5/lib/api/encode-table.js +6 -4
- package/dist/es5/lib/api/encode-table.js.map +1 -1
- package/dist/es5/lib/api/encode.js +14 -4
- package/dist/es5/lib/api/encode.js.map +1 -1
- package/dist/es5/lib/api/load-in-batches.js +40 -11
- package/dist/es5/lib/api/load-in-batches.js.map +1 -1
- package/dist/es5/lib/api/load.js.map +1 -1
- package/dist/es5/lib/api/parse-in-batches.js +12 -14
- package/dist/es5/lib/api/parse-in-batches.js.map +1 -1
- package/dist/es5/lib/api/parse-sync.js +2 -6
- package/dist/es5/lib/api/parse-sync.js.map +1 -1
- package/dist/es5/lib/api/parse.js +38 -39
- package/dist/es5/lib/api/parse.js.map +1 -1
- package/dist/es5/lib/api/save.js.map +1 -1
- package/dist/es5/lib/api/select-loader.js +5 -3
- package/dist/es5/lib/api/select-loader.js.map +1 -1
- package/dist/es5/lib/fetch/fetch-file.js +26 -8
- package/dist/es5/lib/fetch/fetch-file.js.map +1 -1
- package/dist/es5/lib/fetch/fetch-file.node.js +86 -0
- package/dist/es5/lib/fetch/fetch-file.node.js.map +1 -0
- package/dist/es5/lib/filesystems/browser-filesystem.js +2 -2
- package/dist/es5/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/es5/lib/filesystems/read-array-buffer.js.map +1 -1
- package/dist/es5/lib/init.js +1 -1
- package/dist/es5/lib/init.js.map +1 -1
- package/dist/es5/lib/loader-utils/check-errors.js +1 -1
- package/dist/es5/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/es5/lib/loader-utils/get-data.js +1 -1
- package/dist/es5/lib/loader-utils/get-data.js.map +1 -1
- package/dist/es5/lib/loader-utils/get-fetch-function.js +5 -5
- package/dist/es5/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/es5/lib/loader-utils/loader-context.js +2 -2
- package/dist/es5/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/es5/lib/loader-utils/loggers.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-defaults.js +1 -0
- package/dist/es5/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-utils.js +3 -4
- package/dist/es5/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/es5/lib/progress/fetch-progress.js +1 -1
- package/dist/es5/lib/progress/fetch-progress.js.map +1 -1
- package/dist/es5/null-loader.js +6 -14
- package/dist/es5/null-loader.js.map +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js.map +1 -1
- package/dist/esm/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/esm/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/esm/javascript-utils/is-type.js +1 -1
- package/dist/esm/javascript-utils/is-type.js.map +1 -1
- package/dist/esm/lib/api/encode-table.js +2 -2
- package/dist/esm/lib/api/encode-table.js.map +1 -1
- package/dist/esm/lib/api/encode.js +12 -2
- package/dist/esm/lib/api/encode.js.map +1 -1
- package/dist/esm/lib/api/load-in-batches.js +8 -5
- package/dist/esm/lib/api/load-in-batches.js.map +1 -1
- package/dist/esm/lib/api/load.js.map +1 -1
- package/dist/esm/lib/api/parse-in-batches.js +4 -5
- package/dist/esm/lib/api/parse-in-batches.js.map +1 -1
- package/dist/esm/lib/api/parse-sync.js +2 -4
- package/dist/esm/lib/api/parse-sync.js.map +1 -1
- package/dist/esm/lib/api/parse.js +12 -11
- package/dist/esm/lib/api/parse.js.map +1 -1
- package/dist/esm/lib/api/save.js.map +1 -1
- package/dist/esm/lib/api/select-loader.js +5 -3
- package/dist/esm/lib/api/select-loader.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-file.js +16 -7
- package/dist/esm/lib/fetch/fetch-file.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-file.node.js +54 -0
- package/dist/esm/lib/fetch/fetch-file.node.js.map +1 -0
- package/dist/esm/lib/filesystems/browser-filesystem.js +1 -1
- package/dist/esm/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/esm/lib/filesystems/read-array-buffer.js.map +1 -1
- package/dist/esm/lib/init.js +1 -1
- package/dist/esm/lib/init.js.map +1 -1
- package/dist/esm/lib/loader-utils/check-errors.js +1 -1
- package/dist/esm/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/esm/lib/loader-utils/get-data.js +1 -1
- package/dist/esm/lib/loader-utils/get-data.js.map +1 -1
- package/dist/esm/lib/loader-utils/get-fetch-function.js +5 -5
- package/dist/esm/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/esm/lib/loader-utils/loader-context.js +2 -2
- package/dist/esm/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/esm/lib/loader-utils/loggers.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-defaults.js +1 -0
- package/dist/esm/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-utils.js +2 -2
- package/dist/esm/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/esm/lib/progress/fetch-progress.js +1 -1
- package/dist/esm/lib/progress/fetch-progress.js.map +1 -1
- package/dist/esm/null-loader.js +6 -14
- package/dist/esm/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +14 -14
- package/dist/null-worker.js +14 -14
- package/dist/src/bundle.d.ts.map +1 -0
- package/dist/src/core-addons/write-file-browser.d.ts.map +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +5 -4
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/iterators/batch-iterators/timed-batch-iterator.d.ts +5 -0
- package/dist/src/iterators/batch-iterators/timed-batch-iterator.d.ts.map +1 -0
- package/dist/src/iterators/make-iterator/make-array-buffer-iterator.d.ts.map +1 -0
- package/dist/src/iterators/make-iterator/make-blob-iterator.d.ts.map +1 -0
- package/dist/src/iterators/make-iterator/make-iterator.d.ts.map +1 -0
- package/dist/src/iterators/make-iterator/make-stream-iterator.d.ts.map +1 -0
- package/dist/src/iterators/make-iterator/make-string-iterator.d.ts.map +1 -0
- package/dist/src/iterators/make-stream/make-dom-stream.d.ts.map +1 -0
- package/dist/src/iterators/make-stream/make-node-stream.d.ts.map +1 -0
- package/dist/{javascript-utils → src/javascript-utils}/is-type.d.ts +5 -5
- package/dist/src/javascript-utils/is-type.d.ts.map +1 -0
- package/dist/src/lib/api/encode-table.d.ts.map +1 -0
- package/dist/src/lib/api/encode.d.ts +33 -0
- package/dist/src/lib/api/encode.d.ts.map +1 -0
- package/dist/{lib → src/lib}/api/load-in-batches.d.ts +7 -2
- package/dist/src/lib/api/load-in-batches.d.ts.map +1 -0
- package/dist/src/lib/api/load.d.ts +16 -0
- package/dist/src/lib/api/load.d.ts.map +1 -0
- package/dist/src/lib/api/loader-options.d.ts.map +1 -0
- package/dist/src/lib/api/parse-in-batches.d.ts +16 -0
- package/dist/src/lib/api/parse-in-batches.d.ts.map +1 -0
- package/dist/src/lib/api/parse-sync.d.ts +16 -0
- package/dist/src/lib/api/parse-sync.d.ts.map +1 -0
- package/dist/{lib → src/lib}/api/parse.d.ts +13 -3
- package/dist/src/lib/api/parse.d.ts.map +1 -0
- package/dist/src/lib/api/register-loaders.d.ts.map +1 -0
- package/dist/src/lib/api/save.d.ts +4 -0
- package/dist/src/lib/api/save.d.ts.map +1 -0
- package/dist/src/lib/api/select-loader.d.ts.map +1 -0
- package/dist/src/lib/common.d.ts.map +1 -0
- package/dist/src/lib/fetch/fetch-error-message.d.ts.map +1 -0
- package/dist/src/lib/fetch/fetch-file.d.ts +10 -0
- package/dist/src/lib/fetch/fetch-file.d.ts.map +1 -0
- package/dist/src/lib/fetch/fetch-file.node.d.ts +8 -0
- package/dist/src/lib/fetch/fetch-file.node.d.ts.map +1 -0
- package/dist/src/lib/fetch/read-array-buffer.d.ts.map +1 -0
- package/dist/{lib → src/lib}/fetch/read-file.d.ts +1 -1
- package/dist/src/lib/fetch/read-file.d.ts.map +1 -0
- package/dist/src/lib/fetch/write-file.d.ts.map +1 -0
- package/dist/{lib → src/lib}/filesystems/browser-filesystem.d.ts +4 -4
- package/dist/src/lib/filesystems/browser-filesystem.d.ts.map +1 -0
- package/dist/src/lib/filesystems/read-array-buffer.d.ts +8 -0
- package/dist/src/lib/filesystems/read-array-buffer.d.ts.map +1 -0
- package/dist/{lib → src/lib}/init.d.ts.map +1 -1
- package/dist/src/lib/loader-utils/check-errors.d.ts +12 -0
- package/dist/src/lib/loader-utils/check-errors.d.ts.map +1 -0
- package/dist/src/lib/loader-utils/get-data.d.ts.map +1 -0
- package/dist/src/lib/loader-utils/get-fetch-function.d.ts +8 -0
- package/dist/src/lib/loader-utils/get-fetch-function.d.ts.map +1 -0
- package/dist/{lib → src/lib}/loader-utils/loader-context.d.ts +5 -2
- package/dist/src/lib/loader-utils/loader-context.d.ts.map +1 -0
- package/dist/src/lib/loader-utils/loggers.d.ts +19 -0
- package/dist/src/lib/loader-utils/loggers.d.ts.map +1 -0
- package/dist/src/lib/loader-utils/normalize-loader.d.ts.map +1 -0
- package/dist/src/lib/loader-utils/option-defaults.d.ts.map +1 -0
- package/dist/{lib → src/lib}/loader-utils/option-utils.d.ts +1 -1
- package/dist/src/lib/loader-utils/option-utils.d.ts.map +1 -0
- package/dist/{lib → src/lib}/progress/fetch-progress.d.ts +1 -1
- package/dist/src/lib/progress/fetch-progress.d.ts.map +1 -0
- package/dist/src/lib/utils/log.d.ts.map +1 -0
- package/dist/src/lib/utils/mime-type-utils.d.ts.map +1 -0
- package/dist/src/lib/utils/resource-utils.d.ts.map +1 -0
- package/dist/src/lib/utils/response-utils.d.ts.map +1 -0
- package/dist/src/lib/utils/url-utils.d.ts.map +1 -0
- package/dist/src/null-loader.d.ts +13 -0
- package/dist/src/null-loader.d.ts.map +1 -0
- package/dist/src/workers/null-worker.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +7 -6
- package/src/index.ts +6 -5
- package/src/iterators/batch-iterators/timed-batch-iterator.ts +4 -1
- package/src/iterators/make-stream/make-dom-stream.ts +2 -1
- package/src/iterators/make-stream/make-node-stream.ts +5 -2
- package/src/javascript-utils/is-type.ts +12 -8
- package/src/lib/api/encode-table.ts +3 -3
- package/src/lib/api/encode.ts +31 -12
- package/src/lib/api/load-in-batches.ts +54 -11
- package/src/lib/api/load.ts +22 -14
- package/src/lib/api/parse-in-batches.ts +45 -17
- package/src/lib/api/parse-sync.ts +38 -17
- package/src/lib/api/parse.ts +41 -17
- package/src/lib/api/save.ts +2 -2
- package/src/lib/api/select-loader.ts +24 -13
- package/src/lib/fetch/fetch-file.node.ts +61 -0
- package/src/lib/fetch/fetch-file.ts +28 -16
- package/src/lib/filesystems/browser-filesystem.ts +5 -5
- package/src/lib/filesystems/read-array-buffer.ts +6 -18
- package/src/lib/init.ts +1 -0
- package/src/lib/loader-utils/check-errors.ts +21 -4
- package/src/lib/loader-utils/get-data.ts +1 -1
- package/src/lib/loader-utils/get-fetch-function.ts +7 -7
- package/src/lib/loader-utils/loader-context.ts +8 -5
- package/src/lib/loader-utils/loggers.ts +10 -8
- package/src/lib/loader-utils/option-defaults.ts +1 -0
- package/src/lib/loader-utils/option-utils.ts +23 -14
- package/src/lib/progress/fetch-progress.ts +10 -2
- package/src/null-loader.ts +23 -17
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/core-addons/write-file-browser.d.ts.map +0 -1
- package/dist/core-addons/write-file-browser.js +0 -60
- package/dist/es5/lib/filesystems/filesystem.js +0 -2
- package/dist/es5/lib/filesystems/filesystem.js.map +0 -1
- package/dist/esm/lib/filesystems/filesystem.js +0 -2
- package/dist/esm/lib/filesystems/filesystem.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -108
- package/dist/iterators/batch-iterators/timed-batch-iterator.d.ts +0 -5
- package/dist/iterators/batch-iterators/timed-batch-iterator.d.ts.map +0 -1
- package/dist/iterators/batch-iterators/timed-batch-iterator.js +0 -22
- package/dist/iterators/make-iterator/make-array-buffer-iterator.d.ts.map +0 -1
- package/dist/iterators/make-iterator/make-array-buffer-iterator.js +0 -27
- package/dist/iterators/make-iterator/make-blob-iterator.d.ts.map +0 -1
- package/dist/iterators/make-iterator/make-blob-iterator.js +0 -21
- package/dist/iterators/make-iterator/make-iterator.d.ts.map +0 -1
- package/dist/iterators/make-iterator/make-iterator.js +0 -37
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts.map +0 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js +0 -96
- package/dist/iterators/make-iterator/make-string-iterator.d.ts.map +0 -1
- package/dist/iterators/make-iterator/make-string-iterator.js +0 -24
- package/dist/iterators/make-stream/make-dom-stream.d.ts.map +0 -1
- package/dist/iterators/make-stream/make-dom-stream.js +0 -46
- package/dist/iterators/make-stream/make-node-stream.d.ts.map +0 -1
- package/dist/iterators/make-stream/make-node-stream.js +0 -82
- package/dist/javascript-utils/is-type.d.ts.map +0 -1
- package/dist/javascript-utils/is-type.js +0 -41
- package/dist/lib/api/encode-table.d.ts.map +0 -1
- package/dist/lib/api/encode-table.js +0 -54
- package/dist/lib/api/encode.d.ts +0 -26
- package/dist/lib/api/encode.d.ts.map +0 -1
- package/dist/lib/api/encode.js +0 -121
- package/dist/lib/api/load-in-batches.d.ts.map +0 -1
- package/dist/lib/api/load-in-batches.js +0 -33
- package/dist/lib/api/load.d.ts +0 -15
- package/dist/lib/api/load.d.ts.map +0 -1
- package/dist/lib/api/load.js +0 -43
- package/dist/lib/api/loader-options.d.ts.map +0 -1
- package/dist/lib/api/loader-options.js +0 -7
- package/dist/lib/api/parse-in-batches.d.ts +0 -10
- package/dist/lib/api/parse-in-batches.d.ts.map +0 -1
- package/dist/lib/api/parse-in-batches.js +0 -117
- package/dist/lib/api/parse-sync.d.ts +0 -10
- package/dist/lib/api/parse-sync.d.ts.map +0 -1
- package/dist/lib/api/parse-sync.js +0 -59
- package/dist/lib/api/parse.d.ts.map +0 -1
- package/dist/lib/api/parse.js +0 -84
- package/dist/lib/api/register-loaders.d.ts.map +0 -1
- package/dist/lib/api/register-loaders.js +0 -35
- package/dist/lib/api/save.d.ts +0 -4
- package/dist/lib/api/save.d.ts.map +0 -1
- package/dist/lib/api/save.js +0 -15
- package/dist/lib/api/select-loader.d.ts.map +0 -1
- package/dist/lib/api/select-loader.js +0 -253
- package/dist/lib/common.d.ts.map +0 -1
- package/dist/lib/common.js +0 -2
- package/dist/lib/fetch/fetch-error-message.d.ts.map +0 -1
- package/dist/lib/fetch/fetch-error-message.js +0 -25
- package/dist/lib/fetch/fetch-file.d.ts +0 -13
- package/dist/lib/fetch/fetch-file.d.ts.map +0 -1
- package/dist/lib/fetch/fetch-file.js +0 -27
- package/dist/lib/fetch/read-array-buffer.d.ts.map +0 -1
- package/dist/lib/fetch/read-array-buffer.js +0 -41
- package/dist/lib/fetch/read-file.d.ts.map +0 -1
- package/dist/lib/fetch/read-file.js +0 -29
- package/dist/lib/fetch/write-file.d.ts.map +0 -1
- package/dist/lib/fetch/write-file.js +0 -22
- package/dist/lib/filesystems/browser-filesystem.d.ts.map +0 -1
- package/dist/lib/filesystems/browser-filesystem.js +0 -126
- package/dist/lib/filesystems/filesystem.d.ts +0 -46
- package/dist/lib/filesystems/filesystem.d.ts.map +0 -1
- package/dist/lib/filesystems/filesystem.js +0 -2
- package/dist/lib/filesystems/read-array-buffer.d.ts +0 -19
- package/dist/lib/filesystems/read-array-buffer.d.ts.map +0 -1
- package/dist/lib/filesystems/read-array-buffer.js +0 -29
- package/dist/lib/init.js +0 -16
- package/dist/lib/loader-utils/check-errors.d.ts +0 -3
- package/dist/lib/loader-utils/check-errors.d.ts.map +0 -1
- package/dist/lib/loader-utils/check-errors.js +0 -30
- package/dist/lib/loader-utils/get-data.d.ts.map +0 -1
- package/dist/lib/loader-utils/get-data.js +0 -129
- package/dist/lib/loader-utils/get-fetch-function.d.ts +0 -9
- package/dist/lib/loader-utils/get-fetch-function.d.ts.map +0 -1
- package/dist/lib/loader-utils/get-fetch-function.js +0 -31
- package/dist/lib/loader-utils/loader-context.d.ts.map +0 -1
- package/dist/lib/loader-utils/loader-context.js +0 -59
- package/dist/lib/loader-utils/loggers.d.ts +0 -17
- package/dist/lib/loader-utils/loggers.d.ts.map +0 -1
- package/dist/lib/loader-utils/loggers.js +0 -41
- package/dist/lib/loader-utils/normalize-loader.d.ts.map +0 -1
- package/dist/lib/loader-utils/normalize-loader.js +0 -52
- package/dist/lib/loader-utils/option-defaults.d.ts.map +0 -1
- package/dist/lib/loader-utils/option-defaults.js +0 -43
- package/dist/lib/loader-utils/option-utils.d.ts.map +0 -1
- package/dist/lib/loader-utils/option-utils.js +0 -160
- package/dist/lib/progress/fetch-progress.d.ts.map +0 -1
- package/dist/lib/progress/fetch-progress.js +0 -59
- package/dist/lib/utils/log.d.ts.map +0 -1
- package/dist/lib/utils/log.js +0 -6
- package/dist/lib/utils/mime-type-utils.d.ts.map +0 -1
- package/dist/lib/utils/mime-type-utils.js +0 -42
- package/dist/lib/utils/resource-utils.d.ts.map +0 -1
- package/dist/lib/utils/resource-utils.js +0 -90
- package/dist/lib/utils/response-utils.d.ts.map +0 -1
- package/dist/lib/utils/response-utils.js +0 -115
- package/dist/lib/utils/url-utils.d.ts.map +0 -1
- package/dist/lib/utils/url-utils.js +0 -14
- package/dist/null-loader.d.ts +0 -10
- package/dist/null-loader.d.ts.map +0 -1
- package/dist/null-loader.js +0 -56
- package/dist/workers/null-worker.d.ts.map +0 -1
- package/dist/workers/null-worker.js +0 -5
- package/src/lib/filesystems/filesystem.ts +0 -49
- /package/dist/{bundle.d.ts → src/bundle.d.ts} +0 -0
- /package/dist/{core-addons → src/core-addons}/write-file-browser.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-iterator/make-array-buffer-iterator.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-iterator/make-blob-iterator.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-iterator/make-iterator.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-iterator/make-stream-iterator.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-iterator/make-string-iterator.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-stream/make-dom-stream.d.ts +0 -0
- /package/dist/{iterators → src/iterators}/make-stream/make-node-stream.d.ts +0 -0
- /package/dist/{lib → src/lib}/api/encode-table.d.ts +0 -0
- /package/dist/{lib → src/lib}/api/loader-options.d.ts +0 -0
- /package/dist/{lib → src/lib}/api/register-loaders.d.ts +0 -0
- /package/dist/{lib → src/lib}/api/select-loader.d.ts +0 -0
- /package/dist/{lib → src/lib}/common.d.ts +0 -0
- /package/dist/{lib → src/lib}/fetch/fetch-error-message.d.ts +0 -0
- /package/dist/{lib → src/lib}/fetch/read-array-buffer.d.ts +0 -0
- /package/dist/{lib → src/lib}/fetch/write-file.d.ts +0 -0
- /package/dist/{lib → src/lib}/init.d.ts +0 -0
- /package/dist/{lib → src/lib}/loader-utils/get-data.d.ts +0 -0
- /package/dist/{lib → src/lib}/loader-utils/normalize-loader.d.ts +0 -0
- /package/dist/{lib → src/lib}/loader-utils/option-defaults.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/log.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/mime-type-utils.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/resource-utils.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/response-utils.d.ts +0 -0
- /package/dist/{lib → src/lib}/utils/url-utils.d.ts +0 -0
- /package/dist/{workers → src/workers}/null-worker.d.ts +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Random-Access read
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.readArrayBuffer = void 0;
|
|
5
|
-
async function readArrayBuffer(file, start, length) {
|
|
6
|
-
if (file instanceof Blob) {
|
|
7
|
-
const slice = file.slice(start, start + length);
|
|
8
|
-
return await slice.arrayBuffer();
|
|
9
|
-
}
|
|
10
|
-
return await file.read(start, start + length);
|
|
11
|
-
}
|
|
12
|
-
exports.readArrayBuffer = readArrayBuffer;
|
|
13
|
-
/**
|
|
14
|
-
* Read a slice of a Blob or File, without loading the entire file into memory
|
|
15
|
-
* The trick when reading File objects is to read successive "slices" of the File
|
|
16
|
-
* Per spec https://w3c.github.io/FileAPI/, slicing a File only updates the start and end fields
|
|
17
|
-
* Actually reading from file happens in `readAsArrayBuffer`
|
|
18
|
-
* @param blob to read
|
|
19
|
-
export async function readBlob(blob: Blob): Promise<ArrayBuffer> {
|
|
20
|
-
return await new Promise((resolve, reject) => {
|
|
21
|
-
const fileReader = new FileReader();
|
|
22
|
-
fileReader.onload = (event: ProgressEvent<FileReader>) =>
|
|
23
|
-
resolve(event?.target?.result as ArrayBuffer);
|
|
24
|
-
// TODO - reject with a proper Error
|
|
25
|
-
fileReader.onerror = (error: ProgressEvent<FileReader>) => reject(error);
|
|
26
|
-
fileReader.readAsArrayBuffer(blob);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
*/
|
package/dist/lib/init.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// loaders.gl, MIT license
|
|
4
|
-
const log_1 = require("./utils/log");
|
|
5
|
-
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
6
|
-
const version = typeof __VERSION__ !== 'undefined' ? __VERSION__ : '';
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
if (!globalThis.loaders) {
|
|
9
|
-
log_1.log.log(1, `loaders.gl ${version}`)();
|
|
10
|
-
globalThis.loaders = Object.assign(globalThis.loaders || {}, {
|
|
11
|
-
VERSION: version,
|
|
12
|
-
log: log_1.log
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
exports.default = globalThis.loaders;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-errors.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/check-errors.ts"],"names":[],"mappings":"AAAA,wBAAsB,wBAAwB,CAAC,QAAQ,KAAA,iBAatD;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,KAAA,QAIpD"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkFetchResponseStatusSync = exports.checkFetchResponseStatus = void 0;
|
|
4
|
-
async function checkFetchResponseStatus(response) {
|
|
5
|
-
if (!response.ok) {
|
|
6
|
-
let errorMessage = `fetch failed ${response.status} ${response.statusText}`;
|
|
7
|
-
try {
|
|
8
|
-
const text = await response.text();
|
|
9
|
-
if (text) {
|
|
10
|
-
errorMessage += `: ${getErrorText(text)}`;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
catch (error) {
|
|
14
|
-
// ignore error
|
|
15
|
-
}
|
|
16
|
-
throw new Error(errorMessage);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.checkFetchResponseStatus = checkFetchResponseStatus;
|
|
20
|
-
function checkFetchResponseStatusSync(response) {
|
|
21
|
-
if (!response.ok) {
|
|
22
|
-
throw new Error(`fetch failed ${response.status}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.checkFetchResponseStatusSync = checkFetchResponseStatusSync;
|
|
26
|
-
function getErrorText(text) {
|
|
27
|
-
// Look for HTML error texts
|
|
28
|
-
const matches = text.match('<pre>(.*)</pre>');
|
|
29
|
-
return matches ? matches[1] : ` ${text.slice(0, 10)}...`;
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-data.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/get-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,aAAa,EACd,MAAM,0BAA0B,CAAC;AAiBlC,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,WAAW,GAAG,MAAM,CAyCtB;AAGD,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,CA4B/B;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,CAyB7D;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAWxF"}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getReadableStream = exports.getAsyncIterableFromData = exports.getArrayBufferOrStringFromData = exports.getArrayBufferOrStringFromDataSync = void 0;
|
|
4
|
-
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
5
|
-
const is_type_1 = require("../../javascript-utils/is-type");
|
|
6
|
-
const make_iterator_1 = require("../../iterators/make-iterator/make-iterator");
|
|
7
|
-
const response_utils_1 = require("../utils/response-utils");
|
|
8
|
-
const ERR_DATA = 'Cannot convert supplied data type';
|
|
9
|
-
// eslint-disable-next-line complexity
|
|
10
|
-
function getArrayBufferOrStringFromDataSync(data, loader, options) {
|
|
11
|
-
if (loader.text && typeof data === 'string') {
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
if ((0, is_type_1.isBuffer)(data)) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
data = data.buffer;
|
|
17
|
-
}
|
|
18
|
-
if (data instanceof ArrayBuffer) {
|
|
19
|
-
const arrayBuffer = data;
|
|
20
|
-
if (loader.text && !loader.binary) {
|
|
21
|
-
const textDecoder = new TextDecoder('utf8');
|
|
22
|
-
return textDecoder.decode(arrayBuffer);
|
|
23
|
-
}
|
|
24
|
-
return arrayBuffer;
|
|
25
|
-
}
|
|
26
|
-
// We may need to handle offsets
|
|
27
|
-
if (ArrayBuffer.isView(data)) {
|
|
28
|
-
// TextDecoder is invoked on typed arrays and will handle offsets
|
|
29
|
-
if (loader.text && !loader.binary) {
|
|
30
|
-
const textDecoder = new TextDecoder('utf8');
|
|
31
|
-
return textDecoder.decode(data);
|
|
32
|
-
}
|
|
33
|
-
let arrayBuffer = data.buffer;
|
|
34
|
-
// Since we are returning the underlying arrayBuffer, we must create a new copy
|
|
35
|
-
// if this typed array / Buffer is a partial view into the ArryayBuffer
|
|
36
|
-
// TODO - this is a potentially unnecessary copy
|
|
37
|
-
const byteLength = data.byteLength || data.length;
|
|
38
|
-
if (data.byteOffset !== 0 || byteLength !== arrayBuffer.byteLength) {
|
|
39
|
-
// console.warn(`loaders.gl copying arraybuffer of length ${byteLength}`);
|
|
40
|
-
arrayBuffer = arrayBuffer.slice(data.byteOffset, data.byteOffset + byteLength);
|
|
41
|
-
}
|
|
42
|
-
return arrayBuffer;
|
|
43
|
-
}
|
|
44
|
-
throw new Error(ERR_DATA);
|
|
45
|
-
}
|
|
46
|
-
exports.getArrayBufferOrStringFromDataSync = getArrayBufferOrStringFromDataSync;
|
|
47
|
-
// Convert async iterator to a promise
|
|
48
|
-
async function getArrayBufferOrStringFromData(data, loader, options) {
|
|
49
|
-
const isArrayBuffer = data instanceof ArrayBuffer || ArrayBuffer.isView(data);
|
|
50
|
-
if (typeof data === 'string' || isArrayBuffer) {
|
|
51
|
-
return getArrayBufferOrStringFromDataSync(data, loader, options);
|
|
52
|
-
}
|
|
53
|
-
// Blobs and files are FileReader compatible
|
|
54
|
-
if ((0, is_type_1.isBlob)(data)) {
|
|
55
|
-
data = await (0, response_utils_1.makeResponse)(data);
|
|
56
|
-
}
|
|
57
|
-
if ((0, is_type_1.isResponse)(data)) {
|
|
58
|
-
const response = data;
|
|
59
|
-
await (0, response_utils_1.checkResponse)(response);
|
|
60
|
-
return loader.binary ? await response.arrayBuffer() : await response.text();
|
|
61
|
-
}
|
|
62
|
-
if ((0, is_type_1.isReadableStream)(data)) {
|
|
63
|
-
// @ts-expect-error TS2559 options type
|
|
64
|
-
data = (0, make_iterator_1.makeIterator)(data, options);
|
|
65
|
-
}
|
|
66
|
-
if ((0, is_type_1.isIterable)(data) || (0, is_type_1.isAsyncIterable)(data)) {
|
|
67
|
-
// Assume arrayBuffer iterator - attempt to concatenate
|
|
68
|
-
return (0, loader_utils_1.concatenateArrayBuffersAsync)(data);
|
|
69
|
-
}
|
|
70
|
-
throw new Error(ERR_DATA);
|
|
71
|
-
}
|
|
72
|
-
exports.getArrayBufferOrStringFromData = getArrayBufferOrStringFromData;
|
|
73
|
-
async function getAsyncIterableFromData(data, options) {
|
|
74
|
-
if ((0, is_type_1.isIterator)(data)) {
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
if ((0, is_type_1.isResponse)(data)) {
|
|
78
|
-
const response = data;
|
|
79
|
-
// Note Since this function is not async, we currently can't load error message, just status
|
|
80
|
-
await (0, response_utils_1.checkResponse)(response);
|
|
81
|
-
// TODO - bug in polyfill, body can be a Promise under Node.js
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
83
|
-
const body = await response.body;
|
|
84
|
-
// TODO - body can be null?
|
|
85
|
-
return (0, make_iterator_1.makeIterator)(body, options);
|
|
86
|
-
}
|
|
87
|
-
if ((0, is_type_1.isBlob)(data) || (0, is_type_1.isReadableStream)(data)) {
|
|
88
|
-
return (0, make_iterator_1.makeIterator)(data, options);
|
|
89
|
-
}
|
|
90
|
-
if ((0, is_type_1.isAsyncIterable)(data)) {
|
|
91
|
-
return data[Symbol.asyncIterator]();
|
|
92
|
-
}
|
|
93
|
-
return getIterableFromData(data);
|
|
94
|
-
}
|
|
95
|
-
exports.getAsyncIterableFromData = getAsyncIterableFromData;
|
|
96
|
-
async function getReadableStream(data) {
|
|
97
|
-
if ((0, is_type_1.isReadableStream)(data)) {
|
|
98
|
-
return data;
|
|
99
|
-
}
|
|
100
|
-
if ((0, is_type_1.isResponse)(data)) {
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
return data.body;
|
|
103
|
-
}
|
|
104
|
-
const response = await (0, response_utils_1.makeResponse)(data);
|
|
105
|
-
// @ts-ignore
|
|
106
|
-
return response.body;
|
|
107
|
-
}
|
|
108
|
-
exports.getReadableStream = getReadableStream;
|
|
109
|
-
// HELPERS
|
|
110
|
-
function getIterableFromData(data) {
|
|
111
|
-
// generate an iterator that emits a single chunk
|
|
112
|
-
if (ArrayBuffer.isView(data)) {
|
|
113
|
-
return (function* oneChunk() {
|
|
114
|
-
yield data.buffer;
|
|
115
|
-
})();
|
|
116
|
-
}
|
|
117
|
-
if (data instanceof ArrayBuffer) {
|
|
118
|
-
return (function* oneChunk() {
|
|
119
|
-
yield data;
|
|
120
|
-
})();
|
|
121
|
-
}
|
|
122
|
-
if ((0, is_type_1.isIterator)(data)) {
|
|
123
|
-
return data;
|
|
124
|
-
}
|
|
125
|
-
if ((0, is_type_1.isIterable)(data)) {
|
|
126
|
-
return data[Symbol.iterator]();
|
|
127
|
-
}
|
|
128
|
-
throw new Error(ERR_DATA);
|
|
129
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LoaderContext, LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
-
import { fetchFile } from '../fetch/fetch-file';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the current fetch function from options and context
|
|
5
|
-
* @param options
|
|
6
|
-
* @param context
|
|
7
|
-
*/
|
|
8
|
-
export declare function getFetchFunction(options?: LoaderOptions, context?: Omit<LoaderContext, 'fetch'> & Partial<Pick<LoaderContext, 'fetch'>>): ((url: string, options?: RequestInit | undefined) => Promise<Response>) | typeof fetchFile;
|
|
9
|
-
//# sourceMappingURL=get-fetch-function.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-fetch-function.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/get-fetch-function.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAG9C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,8FAuB/E"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getFetchFunction = void 0;
|
|
5
|
-
const is_type_1 = require("../../javascript-utils/is-type");
|
|
6
|
-
const fetch_file_1 = require("../fetch/fetch-file");
|
|
7
|
-
const option_utils_1 = require("./option-utils");
|
|
8
|
-
/**
|
|
9
|
-
* Gets the current fetch function from options and context
|
|
10
|
-
* @param options
|
|
11
|
-
* @param context
|
|
12
|
-
*/
|
|
13
|
-
function getFetchFunction(options, context) {
|
|
14
|
-
const globalOptions = (0, option_utils_1.getGlobalLoaderOptions)();
|
|
15
|
-
const fetchOptions = options || globalOptions;
|
|
16
|
-
// options.fetch can be a function
|
|
17
|
-
if (typeof fetchOptions.fetch === 'function') {
|
|
18
|
-
return fetchOptions.fetch;
|
|
19
|
-
}
|
|
20
|
-
// options.fetch can be an options object
|
|
21
|
-
if ((0, is_type_1.isObject)(fetchOptions.fetch)) {
|
|
22
|
-
return (url) => (0, fetch_file_1.fetchFile)(url, fetchOptions);
|
|
23
|
-
}
|
|
24
|
-
// else refer to context (from parent loader) if available
|
|
25
|
-
if (context?.fetch) {
|
|
26
|
-
return context?.fetch;
|
|
27
|
-
}
|
|
28
|
-
// else return the default fetch function
|
|
29
|
-
return fetch_file_1.fetchFile;
|
|
30
|
-
}
|
|
31
|
-
exports.getFetchFunction = getFetchFunction;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader-context.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/loader-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAKnF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,EAC7E,OAAO,EAAE,aAAa,EACtB,aAAa,EAAE,aAAa,GAAG,IAAI,GAClC,aAAa,CA2Bf;AAGD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,EACtC,OAAO,CAAC,EAAE,aAAa,OAkBxB"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLoadersFromContext = exports.getLoaderContext = void 0;
|
|
4
|
-
const get_fetch_function_1 = require("./get-fetch-function");
|
|
5
|
-
const url_utils_1 = require("../utils/url-utils");
|
|
6
|
-
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
7
|
-
/**
|
|
8
|
-
* "sub" loaders invoked by other loaders get a "context" injected on `this`
|
|
9
|
-
* The context will inject core methods like `parse` and contain information
|
|
10
|
-
* about loaders and options passed in to the top-level `parse` call.
|
|
11
|
-
*
|
|
12
|
-
* @param context
|
|
13
|
-
* @param options
|
|
14
|
-
* @param previousContext
|
|
15
|
-
*/
|
|
16
|
-
function getLoaderContext(context, options, parentContext) {
|
|
17
|
-
// For recursive calls, we already have a context
|
|
18
|
-
// TODO - add any additional loaders to context?
|
|
19
|
-
if (parentContext) {
|
|
20
|
-
return parentContext;
|
|
21
|
-
}
|
|
22
|
-
const newContext = {
|
|
23
|
-
fetch: (0, get_fetch_function_1.getFetchFunction)(options, context),
|
|
24
|
-
...context
|
|
25
|
-
};
|
|
26
|
-
// Parse URLs so that subloaders can easily generate correct strings
|
|
27
|
-
if (newContext.url) {
|
|
28
|
-
const baseUrl = (0, url_utils_1.stripQueryString)(newContext.url);
|
|
29
|
-
newContext.baseUrl = baseUrl;
|
|
30
|
-
newContext.queryString = (0, url_utils_1.extractQueryString)(newContext.url);
|
|
31
|
-
newContext.filename = loader_utils_1.path.filename(baseUrl);
|
|
32
|
-
newContext.baseUrl = loader_utils_1.path.dirname(baseUrl);
|
|
33
|
-
}
|
|
34
|
-
// Recursive loading does not use single loader
|
|
35
|
-
if (!Array.isArray(newContext.loaders)) {
|
|
36
|
-
newContext.loaders = null;
|
|
37
|
-
}
|
|
38
|
-
return newContext;
|
|
39
|
-
}
|
|
40
|
-
exports.getLoaderContext = getLoaderContext;
|
|
41
|
-
// eslint-disable-next-line complexity
|
|
42
|
-
function getLoadersFromContext(loaders, context) {
|
|
43
|
-
// A single non-array loader is force selected, but only on top-level (context === null)
|
|
44
|
-
if (!context && loaders && !Array.isArray(loaders)) {
|
|
45
|
-
return loaders;
|
|
46
|
-
}
|
|
47
|
-
// Create a merged list
|
|
48
|
-
let candidateLoaders;
|
|
49
|
-
if (loaders) {
|
|
50
|
-
candidateLoaders = Array.isArray(loaders) ? loaders : [loaders];
|
|
51
|
-
}
|
|
52
|
-
if (context && context.loaders) {
|
|
53
|
-
const contextLoaders = Array.isArray(context.loaders) ? context.loaders : [context.loaders];
|
|
54
|
-
candidateLoaders = candidateLoaders ? [...candidateLoaders, ...contextLoaders] : contextLoaders;
|
|
55
|
-
}
|
|
56
|
-
// If no loaders, return null to look in globally registered loaders
|
|
57
|
-
return candidateLoaders && candidateLoaders.length ? candidateLoaders : null;
|
|
58
|
-
}
|
|
59
|
-
exports.getLoadersFromContext = getLoadersFromContext;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Log } from '@probe.gl/log';
|
|
2
|
-
export declare const probeLog: Log;
|
|
3
|
-
export declare class NullLog {
|
|
4
|
-
log(): () => void;
|
|
5
|
-
info(): () => void;
|
|
6
|
-
warn(): () => void;
|
|
7
|
-
error(): () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare class ConsoleLog {
|
|
10
|
-
console: any;
|
|
11
|
-
constructor();
|
|
12
|
-
log(...args: any[]): any;
|
|
13
|
-
info(...args: any[]): any;
|
|
14
|
-
warn(...args: any[]): any;
|
|
15
|
-
error(...args: any[]): any;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=loggers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loggers.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/loggers.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAElC,eAAO,MAAM,QAAQ,KAA8B,CAAC;AAGpD,qBAAa,OAAO;IAClB,GAAG;IAGH,IAAI;IAGJ,IAAI;IAGJ,KAAK;CAGN;AAGD,qBAAa,UAAU;IACrB,OAAO,MAAC;;IAKR,GAAG,CAAC,GAAG,IAAI,OAAA;IAGX,IAAI,CAAC,GAAG,IAAI,OAAA;IAGZ,IAAI,CAAC,GAAG,IAAI,OAAA;IAGZ,KAAK,CAAC,GAAG,IAAI,OAAA;CAGd"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConsoleLog = exports.NullLog = exports.probeLog = void 0;
|
|
4
|
-
// probe.gl Log compatible loggers
|
|
5
|
-
const log_1 = require("@probe.gl/log");
|
|
6
|
-
exports.probeLog = new log_1.Log({ id: 'loaders.gl' });
|
|
7
|
-
// Logs nothing
|
|
8
|
-
class NullLog {
|
|
9
|
-
log() {
|
|
10
|
-
return () => { };
|
|
11
|
-
}
|
|
12
|
-
info() {
|
|
13
|
-
return () => { };
|
|
14
|
-
}
|
|
15
|
-
warn() {
|
|
16
|
-
return () => { };
|
|
17
|
-
}
|
|
18
|
-
error() {
|
|
19
|
-
return () => { };
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.NullLog = NullLog;
|
|
23
|
-
// Logs to console
|
|
24
|
-
class ConsoleLog {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.console = console; // eslint-disable-line
|
|
27
|
-
}
|
|
28
|
-
log(...args) {
|
|
29
|
-
return this.console.log.bind(this.console, ...args);
|
|
30
|
-
}
|
|
31
|
-
info(...args) {
|
|
32
|
-
return this.console.info.bind(this.console, ...args);
|
|
33
|
-
}
|
|
34
|
-
warn(...args) {
|
|
35
|
-
return this.console.warn.bind(this.console, ...args);
|
|
36
|
-
}
|
|
37
|
-
error(...args) {
|
|
38
|
-
return this.console.error.bind(this.console, ...args);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.ConsoleLog = ConsoleLog;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/normalize-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAGrD,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAqBpD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiCtD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeLoader = exports.isLoaderObject = void 0;
|
|
4
|
-
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
5
|
-
function isLoaderObject(loader) {
|
|
6
|
-
if (!loader) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (Array.isArray(loader)) {
|
|
10
|
-
loader = loader[0];
|
|
11
|
-
}
|
|
12
|
-
const hasExtensions = Array.isArray(loader?.extensions);
|
|
13
|
-
/* Now handled by types and worker loaders do not have these
|
|
14
|
-
let hasParser =
|
|
15
|
-
loader.parseTextSync ||
|
|
16
|
-
loader.parseSync ||
|
|
17
|
-
loader.parse ||
|
|
18
|
-
loader.parseStream || // TODO Remove, Replace with parseInBatches
|
|
19
|
-
loader.parseInBatches;
|
|
20
|
-
*/
|
|
21
|
-
return hasExtensions;
|
|
22
|
-
}
|
|
23
|
-
exports.isLoaderObject = isLoaderObject;
|
|
24
|
-
function normalizeLoader(loader) {
|
|
25
|
-
// This error is fairly easy to trigger by mixing up import statements etc
|
|
26
|
-
// So we make an exception and add a developer error message for this case
|
|
27
|
-
// To help new users from getting stuck here
|
|
28
|
-
(0, loader_utils_1.assert)(loader, 'null loader');
|
|
29
|
-
(0, loader_utils_1.assert)(isLoaderObject(loader), 'invalid loader');
|
|
30
|
-
// NORMALIZE [LOADER, OPTIONS] => LOADER
|
|
31
|
-
// If [loader, options], create a new loaders object with options merged in
|
|
32
|
-
let options;
|
|
33
|
-
if (Array.isArray(loader)) {
|
|
34
|
-
options = loader[1];
|
|
35
|
-
loader = loader[0];
|
|
36
|
-
loader = {
|
|
37
|
-
...loader,
|
|
38
|
-
options: { ...loader.options, ...options }
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
// NORMALIZE text and binary flags
|
|
42
|
-
// Ensure at least one of text/binary flags are properly set
|
|
43
|
-
// @ts-expect-error
|
|
44
|
-
if (loader?.parseTextSync || loader?.parseText) {
|
|
45
|
-
loader.text = true;
|
|
46
|
-
}
|
|
47
|
-
if (!loader.text) {
|
|
48
|
-
loader.binary = true;
|
|
49
|
-
}
|
|
50
|
-
return loader;
|
|
51
|
-
}
|
|
52
|
-
exports.normalizeLoader = normalizeLoader;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"option-defaults.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/option-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAI5D,eAAO,MAAM,sBAAsB,EAAE,aAqBpC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;CAiBlC,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVED_LOADER_OPTIONS = exports.DEFAULT_LOADER_OPTIONS = void 0;
|
|
4
|
-
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
5
|
-
const loggers_1 = require("./loggers");
|
|
6
|
-
exports.DEFAULT_LOADER_OPTIONS = {
|
|
7
|
-
// baseUri
|
|
8
|
-
fetch: null,
|
|
9
|
-
mimeType: undefined,
|
|
10
|
-
nothrow: false,
|
|
11
|
-
log: new loggers_1.ConsoleLog(),
|
|
12
|
-
CDN: 'https://unpkg.com/@loaders.gl',
|
|
13
|
-
worker: true,
|
|
14
|
-
maxConcurrency: 3,
|
|
15
|
-
maxMobileConcurrency: 1,
|
|
16
|
-
reuseWorkers: loader_utils_1.isBrowser,
|
|
17
|
-
_nodeWorkers: false,
|
|
18
|
-
_workerType: '',
|
|
19
|
-
limit: 0,
|
|
20
|
-
_limitMB: 0,
|
|
21
|
-
batchSize: 'auto',
|
|
22
|
-
batchDebounceMs: 0,
|
|
23
|
-
metadata: false,
|
|
24
|
-
transforms: []
|
|
25
|
-
};
|
|
26
|
-
exports.REMOVED_LOADER_OPTIONS = {
|
|
27
|
-
throws: 'nothrow',
|
|
28
|
-
dataType: '(no longer used)',
|
|
29
|
-
uri: 'baseUri',
|
|
30
|
-
// Warn if fetch options are used on top-level
|
|
31
|
-
method: 'fetch.method',
|
|
32
|
-
headers: 'fetch.headers',
|
|
33
|
-
body: 'fetch.body',
|
|
34
|
-
mode: 'fetch.mode',
|
|
35
|
-
credentials: 'fetch.credentials',
|
|
36
|
-
cache: 'fetch.cache',
|
|
37
|
-
redirect: 'fetch.redirect',
|
|
38
|
-
referrer: 'fetch.referrer',
|
|
39
|
-
referrerPolicy: 'fetch.referrerPolicy',
|
|
40
|
-
integrity: 'fetch.integrity',
|
|
41
|
-
keepalive: 'fetch.keepalive',
|
|
42
|
-
signal: 'fetch.signal'
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"option-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/loader-utils/option-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAKpE;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CASxD;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAO,aAKzC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAI7D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,GAAG,CAAC,EAAE,MAAM,GACX,aAAa,CAMf"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// loaders.gl, MIT license
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.normalizeOptions = exports.setGlobalOptions = exports.getGlobalLoaderOptions = exports.getGlobalLoaderState = void 0;
|
|
5
|
-
const is_type_1 = require("../../javascript-utils/is-type");
|
|
6
|
-
const loggers_1 = require("./loggers");
|
|
7
|
-
const option_defaults_1 = require("./option-defaults");
|
|
8
|
-
/**
|
|
9
|
-
* Helper for safely accessing global loaders.gl variables
|
|
10
|
-
* Wraps initialization of global variable in function to defeat overly aggressive tree-shakers
|
|
11
|
-
*/
|
|
12
|
-
function getGlobalLoaderState() {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
globalThis.loaders = globalThis.loaders || {};
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
const { loaders } = globalThis;
|
|
17
|
-
// Add _state object to keep separate from modules added to globalThis.loaders
|
|
18
|
-
loaders._state = loaders._state || {};
|
|
19
|
-
return loaders._state;
|
|
20
|
-
}
|
|
21
|
-
exports.getGlobalLoaderState = getGlobalLoaderState;
|
|
22
|
-
/**
|
|
23
|
-
* Store global loader options on the global object to increase chances of cross loaders-version interoperability
|
|
24
|
-
* NOTE: This use case is not reliable but can help when testing new versions of loaders.gl with existing frameworks
|
|
25
|
-
* @returns global loader options merged with default loader options
|
|
26
|
-
*/
|
|
27
|
-
const getGlobalLoaderOptions = () => {
|
|
28
|
-
const state = getGlobalLoaderState();
|
|
29
|
-
// Ensure all default loader options from this library are mentioned
|
|
30
|
-
state.globalOptions = state.globalOptions || { ...option_defaults_1.DEFAULT_LOADER_OPTIONS };
|
|
31
|
-
return state.globalOptions;
|
|
32
|
-
};
|
|
33
|
-
exports.getGlobalLoaderOptions = getGlobalLoaderOptions;
|
|
34
|
-
/**
|
|
35
|
-
* Set global loader options
|
|
36
|
-
* @param options
|
|
37
|
-
*/
|
|
38
|
-
function setGlobalOptions(options) {
|
|
39
|
-
const state = getGlobalLoaderState();
|
|
40
|
-
const globalOptions = (0, exports.getGlobalLoaderOptions)();
|
|
41
|
-
state.globalOptions = normalizeOptionsInternal(globalOptions, options);
|
|
42
|
-
}
|
|
43
|
-
exports.setGlobalOptions = setGlobalOptions;
|
|
44
|
-
/**
|
|
45
|
-
* Merges options with global opts and loader defaults, also injects baseUri
|
|
46
|
-
* @param options
|
|
47
|
-
* @param loader
|
|
48
|
-
* @param loaders
|
|
49
|
-
* @param url
|
|
50
|
-
*/
|
|
51
|
-
function normalizeOptions(options, loader, loaders, url) {
|
|
52
|
-
loaders = loaders || [];
|
|
53
|
-
loaders = Array.isArray(loaders) ? loaders : [loaders];
|
|
54
|
-
validateOptions(options, loaders);
|
|
55
|
-
return normalizeOptionsInternal(loader, options, url);
|
|
56
|
-
}
|
|
57
|
-
exports.normalizeOptions = normalizeOptions;
|
|
58
|
-
// VALIDATE OPTIONS
|
|
59
|
-
/**
|
|
60
|
-
* Warn for unsupported options
|
|
61
|
-
* @param options
|
|
62
|
-
* @param loaders
|
|
63
|
-
*/
|
|
64
|
-
function validateOptions(options, loaders) {
|
|
65
|
-
// Check top level options
|
|
66
|
-
validateOptionsObject(options, null, option_defaults_1.DEFAULT_LOADER_OPTIONS, option_defaults_1.REMOVED_LOADER_OPTIONS, loaders);
|
|
67
|
-
for (const loader of loaders) {
|
|
68
|
-
// Get the scoped, loader specific options from the user supplied options
|
|
69
|
-
const idOptions = (options && options[loader.id]) || {};
|
|
70
|
-
// Get scoped, loader specific default and deprecated options from the selected loader
|
|
71
|
-
const loaderOptions = (loader.options && loader.options[loader.id]) || {};
|
|
72
|
-
const deprecatedOptions = (loader.deprecatedOptions && loader.deprecatedOptions[loader.id]) || {};
|
|
73
|
-
// Validate loader specific options
|
|
74
|
-
validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// eslint-disable-next-line max-params, complexity
|
|
78
|
-
function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {
|
|
79
|
-
const loaderName = id || 'Top level';
|
|
80
|
-
const prefix = id ? `${id}.` : '';
|
|
81
|
-
for (const key in options) {
|
|
82
|
-
// If top level option value is an object it could options for a loader, so ignore
|
|
83
|
-
const isSubOptions = !id && (0, is_type_1.isObject)(options[key]);
|
|
84
|
-
const isBaseUriOption = key === 'baseUri' && !id;
|
|
85
|
-
const isWorkerUrlOption = key === 'workerUrl' && id;
|
|
86
|
-
// <loader>.workerUrl requires special handling as it is now auto-generated and no longer specified as a default option.
|
|
87
|
-
if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
|
|
88
|
-
// Issue deprecation warnings
|
|
89
|
-
if (key in deprecatedOptions) {
|
|
90
|
-
loggers_1.probeLog.warn(`${loaderName} loader option \'${prefix}${key}\' no longer supported, use \'${deprecatedOptions[key]}\'`)();
|
|
91
|
-
}
|
|
92
|
-
else if (!isSubOptions) {
|
|
93
|
-
const suggestion = findSimilarOption(key, loaders);
|
|
94
|
-
loggers_1.probeLog.warn(`${loaderName} loader option \'${prefix}${key}\' not recognized. ${suggestion}`)();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
function findSimilarOption(optionKey, loaders) {
|
|
100
|
-
const lowerCaseOptionKey = optionKey.toLowerCase();
|
|
101
|
-
let bestSuggestion = '';
|
|
102
|
-
for (const loader of loaders) {
|
|
103
|
-
for (const key in loader.options) {
|
|
104
|
-
if (optionKey === key) {
|
|
105
|
-
return `Did you mean \'${loader.id}.${key}\'?`;
|
|
106
|
-
}
|
|
107
|
-
const lowerCaseKey = key.toLowerCase();
|
|
108
|
-
const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);
|
|
109
|
-
if (isPartialMatch) {
|
|
110
|
-
bestSuggestion = bestSuggestion || `Did you mean \'${loader.id}.${key}\'?`;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return bestSuggestion;
|
|
115
|
-
}
|
|
116
|
-
function normalizeOptionsInternal(loader, options, url) {
|
|
117
|
-
const loaderDefaultOptions = loader.options || {};
|
|
118
|
-
const mergedOptions = { ...loaderDefaultOptions };
|
|
119
|
-
addUrlOptions(mergedOptions, url);
|
|
120
|
-
// LOGGING: options.log can be set to `null` to defeat logging
|
|
121
|
-
if (mergedOptions.log === null) {
|
|
122
|
-
mergedOptions.log = new loggers_1.NullLog();
|
|
123
|
-
}
|
|
124
|
-
mergeNestedFields(mergedOptions, (0, exports.getGlobalLoaderOptions)());
|
|
125
|
-
mergeNestedFields(mergedOptions, options);
|
|
126
|
-
return mergedOptions;
|
|
127
|
-
}
|
|
128
|
-
// Merge nested options objects
|
|
129
|
-
function mergeNestedFields(mergedOptions, options) {
|
|
130
|
-
for (const key in options) {
|
|
131
|
-
// Check for nested options
|
|
132
|
-
// object in options => either no key in defaultOptions or object in defaultOptions
|
|
133
|
-
if (key in options) {
|
|
134
|
-
const value = options[key];
|
|
135
|
-
if ((0, is_type_1.isPureObject)(value) && (0, is_type_1.isPureObject)(mergedOptions[key])) {
|
|
136
|
-
mergedOptions[key] = {
|
|
137
|
-
...mergedOptions[key],
|
|
138
|
-
...options[key]
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
mergedOptions[key] = options[key];
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// else: No need to merge nested opts, and the initial merge already copied over the nested options
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Harvest information from the url
|
|
150
|
-
* @deprecated This is mainly there to support a hack in the GLTFLoader
|
|
151
|
-
* TODO - baseUri should be a directory, i.e. remove file component from baseUri
|
|
152
|
-
* TODO - extract extension?
|
|
153
|
-
* TODO - extract query parameters?
|
|
154
|
-
* TODO - should these be injected on context instead of options?
|
|
155
|
-
*/
|
|
156
|
-
function addUrlOptions(options, url) {
|
|
157
|
-
if (url && !('baseUri' in options)) {
|
|
158
|
-
options.baseUri = url;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-progress.d.ts","sourceRoot":"","sources":["../../../src/lib/progress/fetch-progress.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAA8B,aAAa,CACzC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,EACtC,UAAU,EAAE,GAAG,EAAE,6BAA6B;AAC9C,MAAM,aAAW,EACjB,OAAO,aAAW,qBA+BnB"}
|