@loaders.gl/core 5.0.0-alpha.12 → 5.0.0-alpha.13
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/LICENSE +1 -1
- package/SCHEMA-README.md +9 -0
- package/SCHEMA-UTILS-README.md +11 -0
- package/dist/dist.dev.js +163 -142
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +87 -91
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/iterators/make-iterator/make-iterator.js +1 -1
- package/dist/iterators/make-iterator/make-iterator.js.map +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js.map +1 -1
- package/dist/iterators/make-iterator/make-string-iterator.js +1 -1
- package/dist/iterators/make-iterator/make-string-iterator.js.map +1 -1
- package/dist/lib/api/core-api.d.ts +1 -1
- package/dist/lib/api/core-api.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +1 -1
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +1 -1
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/encode-table.d.ts +2 -2
- package/dist/lib/api/encode-table.d.ts.map +1 -1
- package/dist/lib/api/encode-table.js +1 -1
- package/dist/lib/api/encode-table.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 +2 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +1 -1
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +1 -1
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +1 -1
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +1 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +1 -1
- package/dist/lib/api/load.js.map +1 -1
- package/dist/lib/api/parse-file.d.ts +1 -1
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +2 -2
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +1 -1
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +40 -4
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +1 -1
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +1 -1
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +1 -1
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +3 -3
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/preload.d.ts +1 -1
- package/dist/lib/api/preload.d.ts.map +1 -1
- package/dist/lib/api/preload.js.map +1 -1
- package/dist/lib/api/register-loaders.d.ts +1 -1
- package/dist/lib/api/register-loaders.d.ts.map +1 -1
- package/dist/lib/api/select-loader.d.ts +1 -1
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +1 -1
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/common.d.ts +1 -1
- package/dist/lib/common.d.ts.map +1 -1
- package/dist/lib/fetch/fetch-file.js +2 -2
- package/dist/lib/fetch/fetch-file.js.map +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts.map +1 -1
- package/dist/lib/filesystems/browser-filesystem.js +1 -1
- package/dist/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/lib/init.js +2 -2
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-data.d.ts +1 -1
- package/dist/lib/loader-utils/get-data.d.ts.map +1 -1
- package/dist/lib/loader-utils/get-data.js +1 -1
- package/dist/lib/loader-utils/get-data.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.d.ts +1 -1
- package/dist/lib/loader-utils/get-fetch-function.d.ts.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loader-context.d.ts +1 -1
- package/dist/lib/loader-utils/loader-context.d.ts.map +1 -1
- package/dist/lib/loader-utils/loader-context.js +1 -1
- package/dist/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +1 -1
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +1 -1
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/normalize-loader.d.ts +1 -1
- package/dist/lib/loader-utils/normalize-loader.d.ts.map +1 -1
- package/dist/lib/loader-utils/normalize-loader.js +1 -1
- package/dist/lib/loader-utils/normalize-loader.js.map +1 -1
- package/dist/lib/loader-utils/option-defaults.d.ts +1 -1
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +1 -1
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +1 -1
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/lib/utils/resource-utils.js +1 -1
- package/dist/lib/utils/resource-utils.js.map +1 -1
- package/dist/lib/utils/response-utils.js +1 -1
- package/dist/lib/utils/response-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +32 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -0
- package/dist/loader-utils/format-types.js +5 -0
- package/dist/loader-utils/format-types.js.map +1 -0
- package/dist/loader-utils/index.cjs +12416 -0
- package/dist/loader-utils/index.cjs.map +6 -0
- package/dist/loader-utils/index.d.ts +122 -0
- package/dist/loader-utils/index.d.ts.map +1 -0
- package/dist/loader-utils/index.js +91 -0
- package/dist/loader-utils/index.js.map +1 -0
- package/dist/loader-utils/json-loader.d.ts +27 -0
- package/dist/loader-utils/json-loader.d.ts.map +1 -0
- package/dist/loader-utils/json-loader.js +32 -0
- package/dist/loader-utils/json-loader.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.d.ts +32 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.js +88 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.d.ts +67 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.js +245 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.d.ts +43 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.js +92 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.d.ts +3 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.js +15 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.d.ts +17 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.js +43 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.d.ts +15 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.js +51 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.d.ts +20 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.js +82 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.d.ts +25 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.js +59 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.js.map +1 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.d.ts +31 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.d.ts.map +1 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.js +20 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.js.map +1 -0
- package/dist/loader-utils/lib/env-utils/assert.d.ts +6 -0
- package/dist/loader-utils/lib/env-utils/assert.d.ts.map +1 -0
- package/dist/loader-utils/lib/env-utils/assert.js +13 -0
- package/dist/loader-utils/lib/env-utils/assert.js.map +1 -0
- package/dist/loader-utils/lib/env-utils/globals.d.ts +15 -0
- package/dist/loader-utils/lib/env-utils/globals.d.ts.map +1 -0
- package/dist/loader-utils/lib/env-utils/globals.js +28 -0
- package/dist/loader-utils/lib/env-utils/globals.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +40 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.js +68 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +54 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +102 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +45 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +13 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +57 -0
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider.js +114 -0
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +1 -0
- package/dist/loader-utils/lib/files/array-buffer-file.d.ts +21 -0
- package/dist/loader-utils/lib/files/array-buffer-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/array-buffer-file.js +36 -0
- package/dist/loader-utils/lib/files/array-buffer-file.js.map +1 -0
- package/dist/loader-utils/lib/files/blob-file.d.ts +19 -0
- package/dist/loader-utils/lib/files/blob-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/blob-file.js +39 -0
- package/dist/loader-utils/lib/files/blob-file.js.map +1 -0
- package/dist/loader-utils/lib/files/file.d.ts +33 -0
- package/dist/loader-utils/lib/files/file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/file.js +5 -0
- package/dist/loader-utils/lib/files/file.js.map +1 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts +37 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/http-file-transport.js +290 -0
- package/dist/loader-utils/lib/files/http-file-transport.js.map +1 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts +49 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/http-file-types.js +5 -0
- package/dist/loader-utils/lib/files/http-file-types.js.map +1 -0
- package/dist/loader-utils/lib/files/http-file.d.ts +55 -0
- package/dist/loader-utils/lib/files/http-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/http-file.js +213 -0
- package/dist/loader-utils/lib/files/http-file.js.map +1 -0
- package/dist/loader-utils/lib/files/node-file-facade.d.ts +22 -0
- package/dist/loader-utils/lib/files/node-file-facade.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/node-file-facade.js +45 -0
- package/dist/loader-utils/lib/files/node-file-facade.js.map +1 -0
- package/dist/loader-utils/lib/files/sources.d.ts +1 -0
- package/dist/loader-utils/lib/files/sources.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/sources.js +155 -0
- package/dist/loader-utils/lib/files/sources.js.map +1 -0
- package/dist/loader-utils/lib/filesystems/filesystem.d.ts +33 -0
- package/dist/loader-utils/lib/filesystems/filesystem.d.ts.map +1 -0
- package/dist/loader-utils/lib/filesystems/filesystem.js +5 -0
- package/dist/loader-utils/lib/filesystems/filesystem.js.map +1 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.d.ts +23 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.d.ts.map +1 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.js +48 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.js.map +1 -0
- package/dist/loader-utils/lib/iterators/async-iteration.d.ts +20 -0
- package/dist/loader-utils/lib/iterators/async-iteration.d.ts.map +1 -0
- package/dist/loader-utils/lib/iterators/async-iteration.js +102 -0
- package/dist/loader-utils/lib/iterators/async-iteration.js.map +1 -0
- package/dist/loader-utils/lib/iterators/text-iterators.d.ts +19 -0
- package/dist/loader-utils/lib/iterators/text-iterators.d.ts.map +1 -0
- package/dist/loader-utils/lib/iterators/text-iterators.js +60 -0
- package/dist/loader-utils/lib/iterators/text-iterators.js.map +1 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.d.ts +59 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.d.ts.map +1 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.js +68 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.js.map +1 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.d.ts +118 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.js +427 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.js.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.d.ts +204 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.js +4226 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.js.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.d.ts +40 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.js +1518 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.js.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts +4 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.js +21 -0
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.d.ts +10 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.d.ts.map +1 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.js +44 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.js.map +1 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.d.ts +18 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.js +40 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.js.map +1 -0
- package/dist/loader-utils/lib/node/buffer.browser.d.ts +11 -0
- package/dist/loader-utils/lib/node/buffer.browser.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/buffer.browser.js +20 -0
- package/dist/loader-utils/lib/node/buffer.browser.js.map +1 -0
- package/dist/loader-utils/lib/node/buffer.d.ts +11 -0
- package/dist/loader-utils/lib/node/buffer.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/buffer.js +35 -0
- package/dist/loader-utils/lib/node/buffer.js.map +1 -0
- package/dist/loader-utils/lib/node/fs.browser.d.ts +2 -0
- package/dist/loader-utils/lib/node/fs.browser.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/fs.browser.js +5 -0
- package/dist/loader-utils/lib/node/fs.browser.js.map +1 -0
- package/dist/loader-utils/lib/node/promisify.d.ts +13 -0
- package/dist/loader-utils/lib/node/promisify.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/promisify.js +19 -0
- package/dist/loader-utils/lib/node/promisify.js.map +1 -0
- package/dist/loader-utils/lib/node/stream.browser.d.ts +2 -0
- package/dist/loader-utils/lib/node/stream.browser.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/stream.browser.js +5 -0
- package/dist/loader-utils/lib/node/stream.browser.js.map +1 -0
- package/dist/loader-utils/lib/node/stream.d.ts +6 -0
- package/dist/loader-utils/lib/node/stream.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/stream.js +8 -0
- package/dist/loader-utils/lib/node/stream.js.map +1 -0
- package/dist/loader-utils/lib/option-utils/merge-options.d.ts +12 -0
- package/dist/loader-utils/lib/option-utils/merge-options.d.ts.map +1 -0
- package/dist/loader-utils/lib/option-utils/merge-options.js +34 -0
- package/dist/loader-utils/lib/option-utils/merge-options.js.map +1 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.d.ts +5 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.d.ts.map +1 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.js +16 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.d.ts +35 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.js +64 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.d.ts +17 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.js +44 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.d.ts +3 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.js +12 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/path.d.ts +24 -0
- package/dist/loader-utils/lib/path-utils/path.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/path.js +173 -0
- package/dist/loader-utils/lib/path-utils/path.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.d.ts +5 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.js +59 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/authentication.d.ts +56 -0
- package/dist/loader-utils/lib/request-utils/authentication.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/authentication.js +67 -0
- package/dist/loader-utils/lib/request-utils/authentication.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.d.ts +7 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.js +20 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.d.ts +70 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.js +203 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.d.ts +201 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.js +636 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-cache.d.ts +62 -0
- package/dist/loader-utils/lib/request-utils/request-cache.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-cache.js +236 -0
- package/dist/loader-utils/lib/request-utils/request-cache.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.d.ts +137 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +379 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.d.ts +71 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.js +174 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.d.ts +56 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.js +261 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts +42 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js +5 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.d.ts +56 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.js +86 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.d.ts +36 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.js +49 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.d.ts +75 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.js +107 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.d.ts +20 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.js +183 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.d.ts +23 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.js +5 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +272 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +97 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.d.ts +39 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.js +35 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +77 -0
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js +56 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +30 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +161 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -0
- package/dist/loader-utils/lib/sources/catalog-source.d.ts +36 -0
- package/dist/loader-utils/lib/sources/catalog-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/catalog-source.js +5 -0
- package/dist/loader-utils/lib/sources/catalog-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/data-source-manager.d.ts +136 -0
- package/dist/loader-utils/lib/sources/data-source-manager.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/data-source-manager.js +376 -0
- package/dist/loader-utils/lib/sources/data-source-manager.js.map +1 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts +79 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/data-source.js +145 -0
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/image-source.d.ts +55 -0
- package/dist/loader-utils/lib/sources/image-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/image-source.js +5 -0
- package/dist/loader-utils/lib/sources/image-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/image-tile-source.d.ts +12 -0
- package/dist/loader-utils/lib/sources/image-tile-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/image-tile-source.js +5 -0
- package/dist/loader-utils/lib/sources/image-tile-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-coverage.d.ts +17 -0
- package/dist/loader-utils/lib/sources/raster-coverage.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-coverage.js +62 -0
- package/dist/loader-utils/lib/sources/raster-coverage.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-region.d.ts +4 -0
- package/dist/loader-utils/lib/sources/raster-region.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-region.js +22 -0
- package/dist/loader-utils/lib/sources/raster-region.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-sampling.d.ts +35 -0
- package/dist/loader-utils/lib/sources/raster-sampling.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-sampling.js +152 -0
- package/dist/loader-utils/lib/sources/raster-sampling.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-source.d.ts +302 -0
- package/dist/loader-utils/lib/sources/raster-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-source.js +20 -0
- package/dist/loader-utils/lib/sources/raster-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/service-capabilities.d.ts +36 -0
- package/dist/loader-utils/lib/sources/service-capabilities.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/service-capabilities.js +5 -0
- package/dist/loader-utils/lib/sources/service-capabilities.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-grid.d.ts +46 -0
- package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-grid.js +128 -0
- package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.d.ts +24 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.js +109 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.d.ts +6 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.js +13 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source.d.ts +190 -0
- package/dist/loader-utils/lib/sources/tile-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source.js +5 -0
- package/dist/loader-utils/lib/sources/tile-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/image-type.d.ts +10 -0
- package/dist/loader-utils/lib/sources/utils/image-type.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/utils/image-type.js +5 -0
- package/dist/loader-utils/lib/sources/utils/image-type.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.d.ts +13 -0
- package/dist/loader-utils/lib/sources/utils/utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.js +26 -0
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -0
- package/dist/loader-utils/lib/sources/vector-source.d.ts +76 -0
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/vector-source.js +5 -0
- package/dist/loader-utils/lib/sources/vector-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +15 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.js +5 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/xyz-grid.d.ts +9 -0
- package/dist/loader-utils/lib/sources/xyz-grid.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/xyz-grid.js +63 -0
- package/dist/loader-utils/lib/sources/xyz-grid.js.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.d.ts +22 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.d.ts.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.js +155 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.js.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts +8 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js +23 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts +41 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +239 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -0
- package/dist/loader-utils/loader-types.d.ts +322 -0
- package/dist/loader-utils/loader-types.d.ts.map +1 -0
- package/dist/loader-utils/loader-types.js +33 -0
- package/dist/loader-utils/loader-types.js.map +1 -0
- package/dist/loader-utils/source-types.d.ts +42 -0
- package/dist/loader-utils/source-types.d.ts.map +1 -0
- package/dist/loader-utils/source-types.js +8 -0
- package/dist/loader-utils/source-types.js.map +1 -0
- package/dist/loader-utils/types.d.ts +24 -0
- package/dist/loader-utils/types.d.ts.map +1 -0
- package/dist/loader-utils/types.js +6 -0
- package/dist/loader-utils/types.js.map +1 -0
- package/dist/loader-utils/workers/json-worker.d.ts +2 -0
- package/dist/loader-utils/workers/json-worker.d.ts.map +1 -0
- package/dist/loader-utils/workers/json-worker.js +7 -0
- package/dist/loader-utils/workers/json-worker.js.map +1 -0
- package/dist/loader-utils/writer-types.d.ts +74 -0
- package/dist/loader-utils/writer-types.d.ts.map +1 -0
- package/dist/loader-utils/writer-types.js +5 -0
- package/dist/loader-utils/writer-types.js.map +1 -0
- package/dist/null-loader.d.ts +2 -2
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -1
- package/dist/null-worker-node.js +7 -7
- package/dist/null-worker.js +7 -7
- package/dist/polyfills/buffer/btoa.node.d.ts +3 -0
- package/dist/polyfills/buffer/btoa.node.d.ts.map +1 -0
- package/dist/polyfills/buffer/btoa.node.js +13 -0
- package/dist/polyfills/buffer/btoa.node.js.map +1 -0
- package/dist/polyfills/buffer/to-array-buffer.node.d.ts +2 -0
- package/dist/polyfills/buffer/to-array-buffer.node.d.ts.map +1 -0
- package/dist/polyfills/buffer/to-array-buffer.node.js +12 -0
- package/dist/polyfills/buffer/to-array-buffer.node.js.map +1 -0
- package/dist/polyfills/crypto/node-hash.d.ts +29 -0
- package/dist/polyfills/crypto/node-hash.d.ts.map +1 -0
- package/dist/polyfills/crypto/node-hash.js +63 -0
- package/dist/polyfills/crypto/node-hash.js.map +1 -0
- package/dist/polyfills/fetch/decode-data-uri.d.ts +11 -0
- package/dist/polyfills/fetch/decode-data-uri.d.ts.map +1 -0
- package/dist/polyfills/fetch/decode-data-uri.js +63 -0
- package/dist/polyfills/fetch/decode-data-uri.js.map +1 -0
- package/dist/polyfills/fetch/fetch-polyfill.d.ts +11 -0
- package/dist/polyfills/fetch/fetch-polyfill.d.ts.map +1 -0
- package/dist/polyfills/fetch/fetch-polyfill.js +141 -0
- package/dist/polyfills/fetch/fetch-polyfill.js.map +1 -0
- package/dist/polyfills/fetch/headers-polyfill.d.ts +34 -0
- package/dist/polyfills/fetch/headers-polyfill.d.ts.map +1 -0
- package/dist/polyfills/fetch/headers-polyfill.js +105 -0
- package/dist/polyfills/fetch/headers-polyfill.js.map +1 -0
- package/dist/polyfills/fetch/response-polyfill.d.ts +22 -0
- package/dist/polyfills/fetch/response-polyfill.d.ts.map +1 -0
- package/dist/polyfills/fetch/response-polyfill.js +81 -0
- package/dist/polyfills/fetch/response-polyfill.js.map +1 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.d.ts +11 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.d.ts.map +1 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.js +32 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.js.map +1 -0
- package/dist/polyfills/file/blob-stream-controller.d.ts +29 -0
- package/dist/polyfills/file/blob-stream-controller.d.ts.map +1 -0
- package/dist/polyfills/file/blob-stream-controller.js +64 -0
- package/dist/polyfills/file/blob-stream-controller.js.map +1 -0
- package/dist/polyfills/file/blob-stream.d.ts +25 -0
- package/dist/polyfills/file/blob-stream.d.ts.map +1 -0
- package/dist/polyfills/file/blob-stream.js +38 -0
- package/dist/polyfills/file/blob-stream.js.map +1 -0
- package/dist/polyfills/file/blob.d.ts +58 -0
- package/dist/polyfills/file/blob.d.ts.map +1 -0
- package/dist/polyfills/file/blob.js +166 -0
- package/dist/polyfills/file/blob.js.map +1 -0
- package/dist/polyfills/file/file-reader.d.ts +24 -0
- package/dist/polyfills/file/file-reader.d.ts.map +1 -0
- package/dist/polyfills/file/file-reader.js +51 -0
- package/dist/polyfills/file/file-reader.js.map +1 -0
- package/dist/polyfills/file/file.d.ts +24 -0
- package/dist/polyfills/file/file.d.ts.map +1 -0
- package/dist/polyfills/file/file.js +41 -0
- package/dist/polyfills/file/file.js.map +1 -0
- package/dist/polyfills/file/install-blob-polyfills.d.ts +9 -0
- package/dist/polyfills/file/install-blob-polyfills.d.ts.map +1 -0
- package/dist/polyfills/file/install-blob-polyfills.js +14 -0
- package/dist/polyfills/file/install-blob-polyfills.js.map +1 -0
- package/dist/polyfills/file/install-file-polyfills.d.ts +3 -0
- package/dist/polyfills/file/install-file-polyfills.d.ts.map +1 -0
- package/dist/polyfills/file/install-file-polyfills.js +20 -0
- package/dist/polyfills/file/install-file-polyfills.js.map +1 -0
- package/dist/polyfills/file/readable-stream.d.ts +5 -0
- package/dist/polyfills/file/readable-stream.d.ts.map +1 -0
- package/dist/polyfills/file/readable-stream.js +8 -0
- package/dist/polyfills/file/readable-stream.js.map +1 -0
- package/dist/polyfills/filesystems/fetch-node.d.ts +8 -0
- package/dist/polyfills/filesystems/fetch-node.d.ts.map +1 -0
- package/dist/polyfills/filesystems/fetch-node.js +88 -0
- package/dist/polyfills/filesystems/fetch-node.js.map +1 -0
- package/dist/polyfills/filesystems/node-file.d.ts +15 -0
- package/dist/polyfills/filesystems/node-file.d.ts.map +1 -0
- package/dist/polyfills/filesystems/node-file.js +138 -0
- package/dist/polyfills/filesystems/node-file.js.map +1 -0
- package/dist/polyfills/filesystems/node-filesystem.d.ts +19 -0
- package/dist/polyfills/filesystems/node-filesystem.d.ts.map +1 -0
- package/dist/polyfills/filesystems/node-filesystem.js +44 -0
- package/dist/polyfills/filesystems/node-filesystem.js.map +1 -0
- package/dist/polyfills/filesystems/stream-utils.node.d.ts +18 -0
- package/dist/polyfills/filesystems/stream-utils.node.d.ts.map +1 -0
- package/dist/polyfills/filesystems/stream-utils.node.js +67 -0
- package/dist/polyfills/filesystems/stream-utils.node.js.map +1 -0
- package/dist/polyfills/images/encode-image-node.d.ts +20 -0
- package/dist/polyfills/images/encode-image-node.d.ts.map +1 -0
- package/dist/polyfills/images/encode-image-node.js +37 -0
- package/dist/polyfills/images/encode-image-node.js.map +1 -0
- package/dist/polyfills/images/image-codecs-node.d.ts +8 -0
- package/dist/polyfills/images/image-codecs-node.d.ts.map +1 -0
- package/dist/polyfills/images/image-codecs-node.js +27 -0
- package/dist/polyfills/images/image-codecs-node.js.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts +38 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.js +64 -0
- package/dist/polyfills/images/node-image-bitmap.js.map +1 -0
- package/dist/polyfills/images/node-image-formats.d.ts +3 -0
- package/dist/polyfills/images/node-image-formats.d.ts.map +1 -0
- package/dist/polyfills/images/node-image-formats.js +6 -0
- package/dist/polyfills/images/node-image-formats.js.map +1 -0
- package/dist/polyfills/images/parse-image-node.d.ts +11 -0
- package/dist/polyfills/images/parse-image-node.d.ts.map +1 -0
- package/dist/polyfills/images/parse-image-node.js +36 -0
- package/dist/polyfills/images/parse-image-node.js.map +1 -0
- package/dist/polyfills/index.browser.d.ts +8 -0
- package/dist/polyfills/index.browser.d.ts.map +1 -0
- package/dist/polyfills/index.browser.js +18 -0
- package/dist/polyfills/index.browser.js.map +1 -0
- package/dist/polyfills/index.cjs +2918 -0
- package/dist/polyfills/index.cjs.map +6 -0
- package/dist/polyfills/index.d.ts +7 -0
- package/dist/polyfills/index.d.ts.map +1 -0
- package/dist/polyfills/index.js +110 -0
- package/dist/polyfills/index.js.map +1 -0
- package/dist/polyfills/libs/encoding-indexes-asian.d.ts +10 -0
- package/dist/polyfills/libs/encoding-indexes-asian.d.ts.map +1 -0
- package/dist/polyfills/libs/encoding-indexes-asian.js +14 -0
- package/dist/polyfills/libs/encoding-indexes-asian.js.map +1 -0
- package/dist/polyfills/load-library/require-utils.node.d.ts +19 -0
- package/dist/polyfills/load-library/require-utils.node.d.ts.map +1 -0
- package/dist/polyfills/load-library/require-utils.node.js +88 -0
- package/dist/polyfills/load-library/require-utils.node.js.map +1 -0
- package/dist/polyfills/streams/make-node-stream.d.ts +10 -0
- package/dist/polyfills/streams/make-node-stream.d.ts.map +1 -0
- package/dist/polyfills/streams/make-node-stream.js +70 -0
- package/dist/polyfills/streams/make-node-stream.js.map +1 -0
- package/dist/polyfills/text-encoder/encoding-indexes.d.ts +31 -0
- package/dist/polyfills/text-encoder/encoding-indexes.d.ts.map +1 -0
- package/dist/polyfills/text-encoder/encoding-indexes.js +35 -0
- package/dist/polyfills/text-encoder/encoding-indexes.js.map +1 -0
- package/dist/polyfills/text-encoder/text-encoder.d.ts +15 -0
- package/dist/polyfills/text-encoder/text-encoder.d.ts.map +1 -0
- package/dist/polyfills/text-encoder/text-encoder.js +2778 -0
- package/dist/polyfills/text-encoder/text-encoder.js.map +1 -0
- package/dist/polyfills/utils/assert.d.ts +2 -0
- package/dist/polyfills/utils/assert.d.ts.map +1 -0
- package/dist/polyfills/utils/assert.js +9 -0
- package/dist/polyfills/utils/assert.js.map +1 -0
- package/dist/polyfills/utils/buffer-utils.d.ts +5 -0
- package/dist/polyfills/utils/buffer-utils.d.ts.map +1 -0
- package/dist/polyfills/utils/buffer-utils.js +34 -0
- package/dist/polyfills/utils/buffer-utils.js.map +1 -0
- package/dist/polyfills/utils/filesystem-types.d.ts +10 -0
- package/dist/polyfills/utils/filesystem-types.d.ts.map +1 -0
- package/dist/polyfills/utils/filesystem-types.js +5 -0
- package/dist/polyfills/utils/filesystem-types.js.map +1 -0
- package/dist/polyfills/utils/is-browser.d.ts +2 -0
- package/dist/polyfills/utils/is-browser.d.ts.map +1 -0
- package/dist/polyfills/utils/is-browser.js +8 -0
- package/dist/polyfills/utils/is-browser.js.map +1 -0
- package/dist/polyfills/utils/path-utils.d.ts +7 -0
- package/dist/polyfills/utils/path-utils.d.ts.map +1 -0
- package/dist/polyfills/utils/path-utils.js +28 -0
- package/dist/polyfills/utils/path-utils.js.map +1 -0
- package/dist/schema/categories/category-gis.d.ts +7 -0
- package/dist/schema/categories/category-gis.d.ts.map +1 -0
- package/dist/schema/categories/category-gis.js +5 -0
- package/dist/schema/categories/category-gis.js.map +1 -0
- package/dist/schema/categories/category-image.d.ts +18 -0
- package/dist/schema/categories/category-image.d.ts.map +1 -0
- package/dist/schema/categories/category-image.js +5 -0
- package/dist/schema/categories/category-image.js.map +1 -0
- package/dist/schema/categories/category-mesh.d.ts +99 -0
- package/dist/schema/categories/category-mesh.d.ts.map +1 -0
- package/dist/schema/categories/category-mesh.js +14 -0
- package/dist/schema/categories/category-mesh.js.map +1 -0
- package/dist/schema/categories/category-table.d.ts +106 -0
- package/dist/schema/categories/category-table.d.ts.map +1 -0
- package/dist/schema/categories/category-table.js +5 -0
- package/dist/schema/categories/category-table.js.map +1 -0
- package/dist/schema/categories/category-texture.d.ts +115 -0
- package/dist/schema/categories/category-texture.d.ts.map +1 -0
- package/dist/schema/categories/category-texture.js +5 -0
- package/dist/schema/categories/category-texture.js.map +1 -0
- package/dist/schema/deprecated/mesh-utils.d.ts +12 -0
- package/dist/schema/deprecated/mesh-utils.d.ts.map +1 -0
- package/dist/schema/deprecated/mesh-utils.js +37 -0
- package/dist/schema/deprecated/mesh-utils.js.map +1 -0
- package/dist/schema/float16.d.ts +19 -0
- package/dist/schema/float16.d.ts.map +1 -0
- package/dist/schema/float16.js +90 -0
- package/dist/schema/float16.js.map +1 -0
- package/dist/schema/geoarrow-metadata.schema.json +117 -0
- package/dist/schema/geometry/arrow-binary-features.d.ts +45 -0
- package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -0
- package/dist/schema/geometry/arrow-binary-features.js +5 -0
- package/dist/schema/geometry/arrow-binary-features.js.map +1 -0
- package/dist/schema/geometry/binary-features.d.ts +30 -0
- package/dist/schema/geometry/binary-features.d.ts.map +1 -0
- package/dist/schema/geometry/binary-features.js +5 -0
- package/dist/schema/geometry/binary-features.js.map +1 -0
- package/dist/schema/geometry/binary-geometries.d.ts +33 -0
- package/dist/schema/geometry/binary-geometries.d.ts.map +1 -0
- package/dist/schema/geometry/binary-geometries.js +5 -0
- package/dist/schema/geometry/binary-geometries.js.map +1 -0
- package/dist/schema/geometry/flat-geometries.d.ts +61 -0
- package/dist/schema/geometry/flat-geometries.d.ts.map +1 -0
- package/dist/schema/geometry/flat-geometries.js +5 -0
- package/dist/schema/geometry/flat-geometries.js.map +1 -0
- package/dist/schema/geometry/geoarrow.d.ts +69 -0
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -0
- package/dist/schema/geometry/geoarrow.js +5 -0
- package/dist/schema/geometry/geoarrow.js.map +1 -0
- package/dist/schema/geoparquet.schema.json +222 -0
- package/dist/schema/geospatial-metadata-zod-schema.cjs +154 -0
- package/dist/schema/geospatial-metadata-zod-schema.cjs.map +6 -0
- package/dist/schema/geospatial-metadata-zod-schema.d.ts +44 -0
- package/dist/schema/geospatial-metadata-zod-schema.d.ts.map +1 -0
- package/dist/schema/geospatial-metadata-zod-schema.js +151 -0
- package/dist/schema/geospatial-metadata-zod-schema.js.map +1 -0
- package/dist/schema/index.cjs +259 -0
- package/dist/schema/index.cjs.map +6 -0
- package/dist/schema/index.d.ts +21 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +9 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/metadata.d.ts +40 -0
- package/dist/schema/metadata.d.ts.map +1 -0
- package/dist/schema/metadata.js +86 -0
- package/dist/schema/metadata.js.map +1 -0
- package/dist/schema/types/batch.d.ts +37 -0
- package/dist/schema/types/batch.d.ts.map +1 -0
- package/dist/schema/types/batch.js +5 -0
- package/dist/schema/types/batch.js.map +1 -0
- package/dist/schema/types/schema.d.ts +70 -0
- package/dist/schema/types/schema.d.ts.map +1 -0
- package/dist/schema/types/schema.js +5 -0
- package/dist/schema/types/schema.js.map +1 -0
- package/dist/schema/types/types.d.ts +16 -0
- package/dist/schema/types/types.d.ts.map +1 -0
- package/dist/schema/types/types.js +6 -0
- package/dist/schema/types/types.js.map +1 -0
- package/dist/schema-utils/arrow-transport.cjs +665 -0
- package/dist/schema-utils/arrow-transport.cjs.map +6 -0
- package/dist/schema-utils/arrow-transport.d.ts +4 -0
- package/dist/schema-utils/arrow-transport.d.ts.map +1 -0
- package/dist/schema-utils/arrow-transport.js +7 -0
- package/dist/schema-utils/arrow-transport.js.map +1 -0
- package/dist/schema-utils/deprecated.d.ts +24 -0
- package/dist/schema-utils/deprecated.d.ts.map +1 -0
- package/dist/schema-utils/deprecated.js +27 -0
- package/dist/schema-utils/deprecated.js.map +1 -0
- package/dist/schema-utils/index.cjs +3423 -0
- package/dist/schema-utils/index.cjs.map +6 -0
- package/dist/schema-utils/index.d.ts +38 -0
- package/dist/schema-utils/index.d.ts.map +1 -0
- package/dist/schema-utils/index.js +77 -0
- package/dist/schema-utils/index.js.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts +72 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js +162 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js.map +1 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts +33 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js +128 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.d.ts +11 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.js +45 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts +11 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.js +33 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.js.map +1 -0
- package/dist/schema-utils/lib/converters/convert.d.ts +10 -0
- package/dist/schema-utils/lib/converters/convert.d.ts.map +1 -0
- package/dist/schema-utils/lib/converters/convert.js +98 -0
- package/dist/schema-utils/lib/converters/convert.js.map +1 -0
- package/dist/schema-utils/lib/converters/converters.d.ts +3 -0
- package/dist/schema-utils/lib/converters/converters.d.ts.map +1 -0
- package/dist/schema-utils/lib/converters/converters.js +5 -0
- package/dist/schema-utils/lib/converters/converters.js.map +1 -0
- package/dist/schema-utils/lib/converters/types.d.ts +35 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -0
- package/dist/schema-utils/lib/converters/types.js +5 -0
- package/dist/schema-utils/lib/converters/types.js.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +44 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +187 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +217 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.d.ts +23 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.js +72 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +23 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.js +54 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts +98 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +407 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.d.ts +39 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.js +441 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.js.map +1 -0
- package/dist/schema-utils/lib/schema/data-type.d.ts +16 -0
- package/dist/schema-utils/lib/schema/data-type.d.ts.map +1 -0
- package/dist/schema-utils/lib/schema/data-type.js +102 -0
- package/dist/schema-utils/lib/schema/data-type.js.map +1 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +14 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.js +101 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.d.ts +19 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.js +37 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.d.ts +43 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.js +5 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.d.ts +12 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.js +82 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +28 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +64 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.d.ts +177 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.js +441 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.d.ts +92 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.js +98 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.d.ts +13 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.js +28 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/index.d.ts +6 -0
- package/dist/schema-utils/lib/table/arrow-api/index.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/index.js +8 -0
- package/dist/schema-utils/lib/table/arrow-api/index.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +10 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +71 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +28 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +104 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +19 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +64 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +20 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +84 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +21 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +86 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +24 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js +5 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +52 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +149 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +10 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.js +46 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +17 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +61 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.d.ts +15 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.js +22 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +9 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +63 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -0
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +23 -0
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/query-arrow-table.js +73 -0
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +24 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +151 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +43 -0
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-table.js +122 -0
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +67 -0
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/make-table.js +102 -0
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/row-utils.d.ts +15 -0
- package/dist/schema-utils/lib/table/tables/row-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/row-utils.js +50 -0
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +68 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.js +352 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-column.d.ts +7 -0
- package/dist/schema-utils/lib/table/tables/table-column.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-column.js +40 -0
- package/dist/schema-utils/lib/table/tables/table-column.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +9 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +19 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +16 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +45 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +12 -0
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-types.js +24 -0
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -0
- package/dist/schema-utils/lib/utils/assert.d.ts +2 -0
- package/dist/schema-utils/lib/utils/assert.d.ts.map +1 -0
- package/dist/schema-utils/lib/utils/assert.js +12 -0
- package/dist/schema-utils/lib/utils/assert.js.map +1 -0
- package/dist/schema-utils/lib/utils/async-queue.d.ts +18 -0
- package/dist/schema-utils/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/schema-utils/lib/utils/async-queue.js +96 -0
- package/dist/schema-utils/lib/utils/async-queue.js.map +1 -0
- package/dist/schema-utils/types/types.d.ts +15 -0
- package/dist/schema-utils/types/types.d.ts.map +1 -0
- package/dist/schema-utils/types/types.js +5 -0
- package/dist/schema-utils/types/types.js.map +1 -0
- package/dist/worker-utils/index.cjs +1448 -0
- package/dist/worker-utils/index.cjs.map +6 -0
- package/dist/worker-utils/index.d.ts +22 -0
- package/dist/worker-utils/index.d.ts.map +1 -0
- package/dist/worker-utils/index.js +40 -0
- package/dist/worker-utils/index.js.map +1 -0
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts +32 -0
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts.map +1 -0
- package/dist/worker-utils/lib/async-queue/async-queue.js +91 -0
- package/dist/worker-utils/lib/async-queue/async-queue.js.map +1 -0
- package/dist/worker-utils/lib/env-utils/assert.d.ts +3 -0
- package/dist/worker-utils/lib/env-utils/assert.d.ts.map +1 -0
- package/dist/worker-utils/lib/env-utils/assert.js +13 -0
- package/dist/worker-utils/lib/env-utils/assert.js.map +1 -0
- package/dist/worker-utils/lib/env-utils/globals.d.ts +22 -0
- package/dist/worker-utils/lib/env-utils/globals.d.ts.map +1 -0
- package/dist/worker-utils/lib/env-utils/globals.js +30 -0
- package/dist/worker-utils/lib/env-utils/globals.js.map +1 -0
- package/dist/worker-utils/lib/env-utils/version.d.ts +2 -0
- package/dist/worker-utils/lib/env-utils/version.d.ts.map +1 -0
- package/dist/worker-utils/lib/env-utils/version.js +20 -0
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -0
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts +42 -0
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -0
- package/dist/worker-utils/lib/library-utils/library-utils.js +248 -0
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.d.ts +14 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.d.ts.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.js +22 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.js.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads.d.ts +15 -0
- package/dist/worker-utils/lib/node/worker_threads.d.ts.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads.js +16 -0
- package/dist/worker-utils/lib/node/worker_threads.js.map +1 -0
- package/dist/worker-utils/lib/npm-tag.d.ts +8 -0
- package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -0
- package/dist/worker-utils/lib/npm-tag.js +11 -0
- package/dist/worker-utils/lib/npm-tag.js.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.d.ts +8 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.d.ts.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.js +18 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.js.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts +45 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +123 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -0
- package/dist/worker-utils/lib/process-utils/process-utils.d.ts +2 -0
- package/dist/worker-utils/lib/process-utils/process-utils.d.ts.map +1 -0
- package/dist/worker-utils/lib/process-utils/process-utils.js +32 -0
- package/dist/worker-utils/lib/process-utils/process-utils.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts +9 -0
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/create-worker.js +123 -0
- package/dist/worker-utils/lib/worker-api/create-worker.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts +27 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +103 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +44 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +312 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.d.ts +9 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.js +35 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts +20 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.js +131 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts +58 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.js +116 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts +34 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.js +73 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts +94 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.js +193 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts +67 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.js +175 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.d.ts +14 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +72 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts +15 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js +86 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.d.ts +6 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.js +27 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.js.map +1 -0
- package/dist/worker-utils/null-worker-node.js +349 -0
- package/dist/worker-utils/null-worker-node.js.map +7 -0
- package/dist/worker-utils/null-worker.js +327 -0
- package/dist/worker-utils/null-worker.js.map +7 -0
- package/dist/worker-utils/types.d.ts +79 -0
- package/dist/worker-utils/types.d.ts.map +1 -0
- package/dist/worker-utils/types.js +5 -0
- package/dist/worker-utils/types.js.map +1 -0
- package/dist/worker-utils/workers/null-worker.d.ts +2 -0
- package/dist/worker-utils/workers/null-worker.d.ts.map +1 -0
- package/dist/worker-utils/workers/null-worker.js +17 -0
- package/dist/worker-utils/workers/null-worker.js.map +1 -0
- package/dist/workers/null-worker-node.js +1 -1
- package/dist/workers/null-worker-node.js.map +1 -1
- package/dist/workers/null-worker.js +1 -1
- package/dist/workers/null-worker.js.map +1 -1
- package/package.json +101 -11
- package/src/index.ts +10 -10
- package/src/iterators/make-iterator/make-iterator.ts +1 -1
- package/src/iterators/make-iterator/make-stream-iterator.ts +1 -1
- package/src/iterators/make-iterator/make-string-iterator.ts +1 -1
- package/src/lib/api/core-api.ts +1 -1
- package/src/lib/api/create-data-source.ts +2 -2
- package/src/lib/api/encode-table.ts +2 -2
- package/src/lib/api/encode.ts +3 -3
- package/src/lib/api/load-in-batches.ts +2 -2
- package/src/lib/api/load-loader.ts +2 -2
- package/src/lib/api/load.ts +2 -2
- package/src/lib/api/parse-file.ts +3 -3
- package/src/lib/api/parse-in-batches.ts +44 -6
- package/src/lib/api/parse-sync.ts +2 -2
- package/src/lib/api/parse.ts +4 -4
- package/src/lib/api/preload.ts +6 -1
- package/src/lib/api/register-loaders.ts +1 -1
- package/src/lib/api/select-loader.ts +3 -3
- package/src/lib/api/select-source.ts +1 -1
- package/src/lib/common.ts +1 -1
- package/src/lib/fetch/fetch-file.ts +2 -2
- package/src/lib/filesystems/browser-filesystem.ts +2 -2
- package/src/lib/init.ts +1 -1
- package/src/lib/loader-utils/get-data.ts +2 -2
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loader-context.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +1 -1
- package/src/lib/loader-utils/normalize-loader.ts +2 -2
- package/src/lib/loader-utils/option-defaults.ts +2 -2
- package/src/lib/loader-utils/option-utils.ts +1 -1
- package/src/lib/utils/resource-utils.ts +1 -1
- package/src/lib/utils/response-utils.ts +1 -1
- package/src/loader-utils/format-types.ts +49 -0
- package/src/loader-utils/index.ts +522 -0
- package/src/loader-utils/json-loader.ts +39 -0
- package/src/loader-utils/lib/binary-utils/array-buffer-utils.ts +114 -0
- package/src/loader-utils/lib/binary-utils/binary-chunk-reader.ts +297 -0
- package/src/loader-utils/lib/binary-utils/dataview-copy-utils.ts +121 -0
- package/src/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.ts +17 -0
- package/src/loader-utils/lib/binary-utils/get-first-characters.ts +46 -0
- package/src/loader-utils/lib/binary-utils/hex-transcoder.ts +54 -0
- package/src/loader-utils/lib/binary-utils/memory-conversion-utils.ts +105 -0
- package/src/loader-utils/lib/binary-utils/memory-copy-utils.ts +69 -0
- package/src/loader-utils/lib/crs/crs-reprojection.ts +52 -0
- package/src/loader-utils/lib/env-utils/assert.ts +13 -0
- package/src/loader-utils/lib/env-utils/globals.ts +36 -0
- package/src/loader-utils/lib/file-provider/data-view-file.ts +83 -0
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +114 -0
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +60 -0
- package/src/loader-utils/lib/file-provider/file-provider.ts +130 -0
- package/src/loader-utils/lib/files/array-buffer-file.ts +46 -0
- package/src/loader-utils/lib/files/blob-file.ts +45 -0
- package/src/loader-utils/lib/files/file.ts +39 -0
- package/src/loader-utils/lib/files/http-file-transport.ts +432 -0
- package/src/loader-utils/lib/files/http-file-types.ts +60 -0
- package/src/loader-utils/lib/files/http-file.ts +267 -0
- package/src/loader-utils/lib/files/node-file-facade.ts +57 -0
- package/src/loader-utils/lib/files/sources.ts +154 -0
- package/src/loader-utils/lib/filesystems/filesystem.ts +40 -0
- package/src/loader-utils/lib/filesystems/node-filesystem-facade.ts +65 -0
- package/src/loader-utils/lib/iterators/async-iteration.ts +136 -0
- package/src/loader-utils/lib/iterators/text-iterators.ts +76 -0
- package/src/loader-utils/lib/javascript-utils/is-type.ts +130 -0
- package/src/loader-utils/lib/laz/LASZIP-LICENSE +202 -0
- package/src/loader-utils/lib/laz/LASZIP-NOTICE +6 -0
- package/src/loader-utils/lib/laz/laz-arithmetic-encoder.ts +446 -0
- package/src/loader-utils/lib/laz/laz-chunk-decoder.ts +5251 -0
- package/src/loader-utils/lib/laz/laz-chunk-encoder.ts +1909 -0
- package/src/loader-utils/lib/log-utils/log.ts +28 -0
- package/src/loader-utils/lib/module-utils/initialize-wasm-module.ts +51 -0
- package/src/loader-utils/lib/module-utils/js-module-utils.ts +44 -0
- package/src/loader-utils/lib/node/buffer.browser.ts +22 -0
- package/src/loader-utils/lib/node/buffer.ts +40 -0
- package/src/loader-utils/lib/node/fs.browser.ts +5 -0
- package/src/loader-utils/lib/node/promisify.ts +72 -0
- package/src/loader-utils/lib/node/stream.browser.ts +5 -0
- package/src/loader-utils/lib/node/stream.ts +12 -0
- package/src/loader-utils/lib/option-utils/merge-options.ts +50 -0
- package/src/loader-utils/lib/parser-utils/parse-json.ts +16 -0
- package/src/loader-utils/lib/path-utils/cached-uri-resolver.ts +69 -0
- package/src/loader-utils/lib/path-utils/file-aliases.ts +49 -0
- package/src/loader-utils/lib/path-utils/get-cwd.ts +12 -0
- package/src/loader-utils/lib/path-utils/path.ts +173 -0
- package/src/loader-utils/lib/request-utils/abort-utils.ts +64 -0
- package/src/loader-utils/lib/request-utils/authentication.ts +134 -0
- package/src/loader-utils/lib/request-utils/parse-content-type.ts +22 -0
- package/src/loader-utils/lib/request-utils/range-request-cache.ts +279 -0
- package/src/loader-utils/lib/request-utils/range-request-scheduler.ts +899 -0
- package/src/loader-utils/lib/request-utils/request-cache.ts +296 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +576 -0
- package/src/loader-utils/lib/request-utils/request-scheduler.ts +230 -0
- package/src/loader-utils/lib/scan-utils/columnar-predicate.ts +397 -0
- package/src/loader-utils/lib/scan-utils/experimental-scan-options.ts +46 -0
- package/src/loader-utils/lib/scan-utils/point-cloud-query.ts +176 -0
- package/src/loader-utils/lib/scan-utils/raster-query.ts +82 -0
- package/src/loader-utils/lib/scan-utils/relational-query.ts +188 -0
- package/src/loader-utils/lib/scan-utils/scan-executor.ts +208 -0
- package/src/loader-utils/lib/scan-utils/scan-fragments.ts +33 -0
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +439 -0
- package/src/loader-utils/lib/scan-utils/table-query-explain.ts +88 -0
- package/src/loader-utils/lib/scan-utils/table-query.ts +163 -0
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +200 -0
- package/src/loader-utils/lib/sources/catalog-source.ts +42 -0
- package/src/loader-utils/lib/sources/data-source-manager.ts +569 -0
- package/src/loader-utils/lib/sources/data-source.ts +236 -0
- package/src/loader-utils/lib/sources/image-source.ts +66 -0
- package/src/loader-utils/lib/sources/image-tile-source.ts +22 -0
- package/src/loader-utils/lib/sources/raster-coverage.ts +92 -0
- package/src/loader-utils/lib/sources/raster-region.ts +35 -0
- package/src/loader-utils/lib/sources/raster-sampling.ts +213 -0
- package/src/loader-utils/lib/sources/raster-source.ts +344 -0
- package/src/loader-utils/lib/sources/service-capabilities.ts +50 -0
- package/src/loader-utils/lib/sources/tile-grid.ts +162 -0
- package/src/loader-utils/lib/sources/tile-source-adapter.ts +126 -0
- package/src/loader-utils/lib/sources/tile-source-utils.ts +19 -0
- package/src/loader-utils/lib/sources/tile-source.ts +198 -0
- package/src/loader-utils/lib/sources/utils/image-type.ts +14 -0
- package/src/loader-utils/lib/sources/utils/utils.ts +31 -0
- package/src/loader-utils/lib/sources/vector-source.ts +89 -0
- package/src/loader-utils/lib/sources/vector-tile-source.ts +29 -0
- package/src/loader-utils/lib/sources/xyz-grid.ts +82 -0
- package/src/loader-utils/lib/worker-loader-utils/create-loader-worker.ts +233 -0
- package/src/loader-utils/lib/worker-loader-utils/encode-with-worker.ts +28 -0
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +347 -0
- package/src/loader-utils/loader-types.ts +531 -0
- package/src/loader-utils/source-types.ts +76 -0
- package/src/loader-utils/types.ts +83 -0
- package/src/loader-utils/workers/json-worker.ts +8 -0
- package/src/loader-utils/writer-types.ts +107 -0
- package/src/null-loader.ts +2 -2
- package/src/polyfills/README.md +16 -0
- package/src/polyfills/buffer/btoa.node.ts +15 -0
- package/src/polyfills/buffer/to-array-buffer.node.ts +12 -0
- package/src/polyfills/crypto/node-hash.ts +78 -0
- package/src/polyfills/fetch/decode-data-uri.ts +71 -0
- package/src/polyfills/fetch/fetch-polyfill.ts +165 -0
- package/src/polyfills/fetch/headers-polyfill.ts +119 -0
- package/src/polyfills/fetch/response-polyfill.ts +101 -0
- package/src/polyfills/fetch/utils/decode-data-uri.node.ts +34 -0
- package/src/polyfills/file/blob-stream-controller.ts +69 -0
- package/src/polyfills/file/blob-stream.ts +40 -0
- package/src/polyfills/file/blob.ts +177 -0
- package/src/polyfills/file/file-reader.ts +59 -0
- package/src/polyfills/file/file.ts +45 -0
- package/src/polyfills/file/install-blob-polyfills.ts +17 -0
- package/src/polyfills/file/install-file-polyfills.ts +24 -0
- package/src/polyfills/file/readable-stream.ts +8 -0
- package/src/polyfills/filesystems/fetch-node.ts +98 -0
- package/src/polyfills/filesystems/node-file.ts +169 -0
- package/src/polyfills/filesystems/node-filesystem.ts +54 -0
- package/src/polyfills/filesystems/stream-utils.node.ts +81 -0
- package/src/polyfills/images/encode-image-node.ts +45 -0
- package/src/polyfills/images/encode-image.node.ts.disabled +41 -0
- package/src/polyfills/images/image-codecs-node.ts +40 -0
- package/src/polyfills/images/node-image-bitmap.ts +81 -0
- package/src/polyfills/images/node-image-formats.ts +6 -0
- package/src/polyfills/images/parse-image-node.ts +54 -0
- package/src/polyfills/images/parse-image.node.ts.disabled +55 -0
- package/src/polyfills/index.browser.ts +23 -0
- package/src/polyfills/index.ts +154 -0
- package/src/polyfills/libs/encoding-indexes-asian.js +15 -0
- package/src/polyfills/load-library/require-utils.node.ts +108 -0
- package/src/polyfills/streams/make-node-stream.ts +83 -0
- package/src/polyfills/text-encoder/encoding-indexes.ts +36 -0
- package/src/polyfills/text-encoder/text-encoder.ts +3085 -0
- package/src/polyfills/utils/assert.ts +9 -0
- package/src/polyfills/utils/buffer-utils.ts +40 -0
- package/src/polyfills/utils/filesystem-types.ts +13 -0
- package/src/polyfills/utils/is-browser.ts +8 -0
- package/src/polyfills/utils/path-utils.ts +31 -0
- package/src/polyfills/wip/fetch-browser/fetch-file.browser.d.ts +34 -0
- package/src/schema/categories/category-gis.ts +63 -0
- package/src/schema/categories/category-image.ts +23 -0
- package/src/schema/categories/category-mesh.ts +138 -0
- package/src/schema/categories/category-table.ts +125 -0
- package/src/schema/categories/category-texture.ts +259 -0
- package/src/schema/deprecated/mesh-utils.ts +46 -0
- package/src/schema/float16.ts +111 -0
- package/src/schema/geometry/arrow-binary-features.ts +54 -0
- package/src/schema/geometry/binary-features.ts +43 -0
- package/src/schema/geometry/binary-geometries.ts +45 -0
- package/src/schema/geometry/flat-geometries.ts +72 -0
- package/src/schema/geometry/geoarrow.ts +116 -0
- package/src/schema/geospatial-metadata-zod-schema.ts +163 -0
- package/src/schema/index.ts +169 -0
- package/src/schema/metadata.ts +115 -0
- package/src/schema/types/batch.ts +47 -0
- package/src/schema/types/schema.ts +86 -0
- package/src/schema/types/types.ts +52 -0
- package/src/schema-utils/arrow-transport.ts +7 -0
- package/src/schema-utils/deprecated.ts +53 -0
- package/src/schema-utils/index.ts +165 -0
- package/src/schema-utils/lib/arrow/arrow-table-transport.ts +260 -0
- package/src/schema-utils/lib/arrow/split-arrow-buffers.ts +235 -0
- package/src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts +78 -0
- package/src/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.ts +48 -0
- package/src/schema-utils/lib/converters/convert.ts +142 -0
- package/src/schema-utils/lib/converters/converters.ts +6 -0
- package/src/schema-utils/lib/converters/types.ts +44 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +311 -0
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +257 -0
- package/src/schema-utils/lib/mesh/deduce-mesh-schema.ts +85 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +73 -0
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +485 -0
- package/src/schema-utils/lib/schema/convert-arrow-schema.ts +552 -0
- package/src/schema-utils/lib/schema/data-type.ts +122 -0
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +119 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-field.ts +53 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-interface.ts +84 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-schema.ts +101 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +85 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-type.ts +500 -0
- package/src/schema-utils/lib/table/arrow-api/enum.ts +99 -0
- package/src/schema-utils/lib/table/arrow-api/get-type-info.ts +38 -0
- package/src/schema-utils/lib/table/arrow-api/index.ts +50 -0
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +190 -0
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +85 -0
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +123 -0
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +82 -0
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +104 -0
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +108 -0
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +28 -0
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +185 -0
- package/src/schema-utils/lib/table/batches/convert-batches.ts +83 -0
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +81 -0
- package/src/schema-utils/lib/table/batches/make-table-batch-iterator.ts +25 -0
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +84 -0
- package/src/schema-utils/lib/table/query-arrow-table.ts +130 -0
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +198 -0
- package/src/schema-utils/lib/table/tables/convert-table.ts +152 -0
- package/src/schema-utils/lib/table/tables/make-table.ts +127 -0
- package/src/schema-utils/lib/table/tables/row-utils.ts +59 -0
- package/src/schema-utils/lib/table/tables/table-accessors.ts +418 -0
- package/src/schema-utils/lib/table/tables/table-column.ts +49 -0
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +35 -0
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +57 -0
- package/src/schema-utils/lib/table/tables/table-types.ts +37 -0
- package/src/schema-utils/lib/utils/assert.ts +12 -0
- package/src/schema-utils/lib/utils/async-queue.ts +109 -0
- package/src/schema-utils/types/types.ts +45 -0
- package/src/worker-utils/index.ts +80 -0
- package/src/worker-utils/lib/async-queue/async-queue.ts +100 -0
- package/src/worker-utils/lib/env-utils/assert.ts +14 -0
- package/src/worker-utils/lib/env-utils/globals.ts +40 -0
- package/src/worker-utils/lib/env-utils/version.ts +25 -0
- package/src/worker-utils/lib/library-utils/library-utils.ts +303 -0
- package/src/worker-utils/lib/node/worker_threads-browser.ts +34 -0
- package/src/worker-utils/lib/node/worker_threads.ts +58 -0
- package/src/worker-utils/lib/npm-tag.ts +11 -0
- package/src/worker-utils/lib/process-utils/child-process-proxy.browser.ts +23 -0
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +165 -0
- package/src/worker-utils/lib/process-utils/process-utils.ts +34 -0
- package/src/worker-utils/lib/worker-api/create-worker.ts +166 -0
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +129 -0
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +413 -0
- package/src/worker-utils/lib/worker-api/validate-worker-version.ts +44 -0
- package/src/worker-utils/lib/worker-farm/worker-body.ts +145 -0
- package/src/worker-utils/lib/worker-farm/worker-farm.ts +144 -0
- package/src/worker-utils/lib/worker-farm/worker-job.ts +83 -0
- package/src/worker-utils/lib/worker-farm/worker-pool.ts +263 -0
- package/src/worker-utils/lib/worker-farm/worker-thread.ts +206 -0
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +81 -0
- package/src/worker-utils/lib/worker-utils/get-transfer-list.ts +93 -0
- package/src/worker-utils/lib/worker-utils/remove-nontransferable-options.ts +27 -0
- package/src/worker-utils/types.ts +125 -0
- package/src/worker-utils/workers/null-worker.ts +20 -0
- package/src/workers/null-worker-node.ts +1 -1
- package/src/workers/null-worker.ts +1 -1
|
@@ -0,0 +1,2918 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res, err) => function __init() {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
+
|
|
38
|
+
// src/polyfills/images/node-image-formats.ts
|
|
39
|
+
var NODE_FORMAT_SUPPORT;
|
|
40
|
+
var init_node_image_formats = __esm({
|
|
41
|
+
"src/polyfills/images/node-image-formats.ts"() {
|
|
42
|
+
"use strict";
|
|
43
|
+
NODE_FORMAT_SUPPORT = ["image/png", "image/jpeg", "image/gif"];
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// src/polyfills/images/parse-image-node.ts
|
|
48
|
+
var parse_image_node_exports = {};
|
|
49
|
+
__export(parse_image_node_exports, {
|
|
50
|
+
NODE_FORMAT_SUPPORT: () => NODE_FORMAT_SUPPORT,
|
|
51
|
+
parseImageNode: () => parseImageNode
|
|
52
|
+
});
|
|
53
|
+
async function parseImageNode(arrayBuffer, mimeType) {
|
|
54
|
+
if (!mimeType) {
|
|
55
|
+
throw new Error("MIMEType is required to parse image under Node.js");
|
|
56
|
+
}
|
|
57
|
+
const buffer = arrayBuffer instanceof Buffer ? arrayBuffer : Buffer.from(arrayBuffer);
|
|
58
|
+
const ndarray2 = await getPixelsAsync(buffer, mimeType);
|
|
59
|
+
return ndarray2;
|
|
60
|
+
}
|
|
61
|
+
function getPixelsAsync(buffer, mimeType) {
|
|
62
|
+
return new Promise(
|
|
63
|
+
(resolve) => (0, import_get_pixels.default)(buffer, mimeType, (err, ndarray2) => {
|
|
64
|
+
if (err) {
|
|
65
|
+
throw err;
|
|
66
|
+
}
|
|
67
|
+
const shape = [...ndarray2.shape];
|
|
68
|
+
const layers = ndarray2.shape.length === 4 ? ndarray2.shape.shift() : 1;
|
|
69
|
+
const data = ndarray2.data instanceof Buffer ? new Uint8Array(ndarray2.data) : ndarray2.data;
|
|
70
|
+
resolve({
|
|
71
|
+
shape,
|
|
72
|
+
data,
|
|
73
|
+
width: ndarray2.shape[0],
|
|
74
|
+
height: ndarray2.shape[1],
|
|
75
|
+
components: ndarray2.shape[2],
|
|
76
|
+
// TODO - error
|
|
77
|
+
layers: layers ? [layers] : []
|
|
78
|
+
});
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
var import_get_pixels;
|
|
83
|
+
var init_parse_image_node = __esm({
|
|
84
|
+
"src/polyfills/images/parse-image-node.ts"() {
|
|
85
|
+
"use strict";
|
|
86
|
+
import_get_pixels = __toESM(require("get-pixels"), 1);
|
|
87
|
+
init_node_image_formats();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// src/polyfills/buffer/to-array-buffer.node.ts
|
|
92
|
+
function bufferToArrayBuffer(buffer) {
|
|
93
|
+
if (Buffer.isBuffer(buffer)) {
|
|
94
|
+
const typedArray = new Uint8Array(buffer);
|
|
95
|
+
return typedArray.buffer;
|
|
96
|
+
}
|
|
97
|
+
return buffer;
|
|
98
|
+
}
|
|
99
|
+
var init_to_array_buffer_node = __esm({
|
|
100
|
+
"src/polyfills/buffer/to-array-buffer.node.ts"() {
|
|
101
|
+
"use strict";
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// src/polyfills/images/encode-image-node.ts
|
|
106
|
+
var encode_image_node_exports = {};
|
|
107
|
+
__export(encode_image_node_exports, {
|
|
108
|
+
encodeImageNode: () => encodeImageNode,
|
|
109
|
+
encodeImageToStreamNode: () => encodeImageToStreamNode
|
|
110
|
+
});
|
|
111
|
+
function encodeImageToStreamNode(image, options) {
|
|
112
|
+
const type = options.type ? options.type.replace("image/", "") : "jpeg";
|
|
113
|
+
const pixels = (0, import_ndarray.default)(image.data, [image.width, image.height, 4], [4, image.width * 4, 1], 0);
|
|
114
|
+
return (0, import_save_pixels.default)(pixels, type, options);
|
|
115
|
+
}
|
|
116
|
+
function encodeImageNode(image, options) {
|
|
117
|
+
const imageStream = encodeImageToStreamNode(image, options);
|
|
118
|
+
return new Promise((resolve) => {
|
|
119
|
+
const buffers = [];
|
|
120
|
+
imageStream.on("data", (buffer) => buffers.push(buffer));
|
|
121
|
+
imageStream.on("end", () => {
|
|
122
|
+
const buffer = Buffer.concat(buffers);
|
|
123
|
+
resolve(bufferToArrayBuffer(buffer));
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
var import_save_pixels, import_ndarray;
|
|
128
|
+
var init_encode_image_node = __esm({
|
|
129
|
+
"src/polyfills/images/encode-image-node.ts"() {
|
|
130
|
+
"use strict";
|
|
131
|
+
import_save_pixels = __toESM(require("save-pixels"), 1);
|
|
132
|
+
import_ndarray = __toESM(require("ndarray"), 1);
|
|
133
|
+
init_to_array_buffer_node();
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// src/polyfills/index.ts
|
|
138
|
+
var index_exports = {};
|
|
139
|
+
__export(index_exports, {
|
|
140
|
+
Blob: () => Blob_,
|
|
141
|
+
File: () => File_,
|
|
142
|
+
addAliases: () => addAliases,
|
|
143
|
+
installFilePolyfills: () => installFilePolyfills,
|
|
144
|
+
makeNodeStream: () => makeNodeStream,
|
|
145
|
+
nodeVersion: () => nodeVersion,
|
|
146
|
+
setPathPrefix: () => setPathPrefix
|
|
147
|
+
});
|
|
148
|
+
module.exports = __toCommonJS(index_exports);
|
|
149
|
+
|
|
150
|
+
// src/polyfills/utils/is-browser.ts
|
|
151
|
+
var isBrowser = (
|
|
152
|
+
// @ts-ignore process.browser
|
|
153
|
+
typeof process !== "object" || String(process) !== "[object process]" || process.browser
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
// src/polyfills/text-encoder/encoding-indexes.ts
|
|
157
|
+
var encoding_indexes_default = {
|
|
158
|
+
"ibm866": [1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 9617, 9618, 9619, 9474, 9508, 9569, 9570, 9558, 9557, 9571, 9553, 9559, 9565, 9564, 9563, 9488, 9492, 9524, 9516, 9500, 9472, 9532, 9566, 9567, 9562, 9556, 9577, 9574, 9568, 9552, 9580, 9575, 9576, 9572, 9573, 9561, 9560, 9554, 9555, 9579, 9578, 9496, 9484, 9608, 9604, 9612, 9616, 9600, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1025, 1105, 1028, 1108, 1031, 1111, 1038, 1118, 176, 8729, 183, 8730, 8470, 164, 9632, 160],
|
|
159
|
+
"iso-8859-2": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 728, 321, 164, 317, 346, 167, 168, 352, 350, 356, 377, 173, 381, 379, 176, 261, 731, 322, 180, 318, 347, 711, 184, 353, 351, 357, 378, 733, 382, 380, 340, 193, 194, 258, 196, 313, 262, 199, 268, 201, 280, 203, 282, 205, 206, 270, 272, 323, 327, 211, 212, 336, 214, 215, 344, 366, 218, 368, 220, 221, 354, 223, 341, 225, 226, 259, 228, 314, 263, 231, 269, 233, 281, 235, 283, 237, 238, 271, 273, 324, 328, 243, 244, 337, 246, 247, 345, 367, 250, 369, 252, 253, 355, 729],
|
|
160
|
+
"iso-8859-3": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 294, 728, 163, 164, null, 292, 167, 168, 304, 350, 286, 308, 173, null, 379, 176, 295, 178, 179, 180, 181, 293, 183, 184, 305, 351, 287, 309, 189, null, 380, 192, 193, 194, null, 196, 266, 264, 199, 200, 201, 202, 203, 204, 205, 206, 207, null, 209, 210, 211, 212, 288, 214, 215, 284, 217, 218, 219, 220, 364, 348, 223, 224, 225, 226, null, 228, 267, 265, 231, 232, 233, 234, 235, 236, 237, 238, 239, null, 241, 242, 243, 244, 289, 246, 247, 285, 249, 250, 251, 252, 365, 349, 729],
|
|
161
|
+
"iso-8859-4": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 312, 342, 164, 296, 315, 167, 168, 352, 274, 290, 358, 173, 381, 175, 176, 261, 731, 343, 180, 297, 316, 711, 184, 353, 275, 291, 359, 330, 382, 331, 256, 193, 194, 195, 196, 197, 198, 302, 268, 201, 280, 203, 278, 205, 206, 298, 272, 325, 332, 310, 212, 213, 214, 215, 216, 370, 218, 219, 220, 360, 362, 223, 257, 225, 226, 227, 228, 229, 230, 303, 269, 233, 281, 235, 279, 237, 238, 299, 273, 326, 333, 311, 244, 245, 246, 247, 248, 371, 250, 251, 252, 361, 363, 729],
|
|
162
|
+
"iso-8859-5": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 173, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 8470, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 167, 1118, 1119],
|
|
163
|
+
"iso-8859-6": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, null, null, null, 164, null, null, null, null, null, null, null, 1548, 173, null, null, null, null, null, null, null, null, null, null, null, null, null, 1563, null, null, null, 1567, null, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, null, null, null, null, null, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, null, null, null, null, null, null, null, null, null, null, null, null, null],
|
|
164
|
+
"iso-8859-7": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 8216, 8217, 163, 8364, 8367, 166, 167, 168, 169, 890, 171, 172, 173, null, 8213, 176, 177, 178, 179, 900, 901, 902, 183, 904, 905, 906, 187, 908, 189, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, null, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, null],
|
|
165
|
+
"iso-8859-8": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, null, 162, 163, 164, 165, 166, 167, 168, 169, 215, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 247, 187, 188, 189, 190, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8215, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, null, null, 8206, 8207, null],
|
|
166
|
+
"iso-8859-10": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 274, 290, 298, 296, 310, 167, 315, 272, 352, 358, 381, 173, 362, 330, 176, 261, 275, 291, 299, 297, 311, 183, 316, 273, 353, 359, 382, 8213, 363, 331, 256, 193, 194, 195, 196, 197, 198, 302, 268, 201, 280, 203, 278, 205, 206, 207, 208, 325, 332, 211, 212, 213, 214, 360, 216, 370, 218, 219, 220, 221, 222, 223, 257, 225, 226, 227, 228, 229, 230, 303, 269, 233, 281, 235, 279, 237, 238, 239, 240, 326, 333, 243, 244, 245, 246, 361, 248, 371, 250, 251, 252, 253, 254, 312],
|
|
167
|
+
"iso-8859-13": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 8221, 162, 163, 164, 8222, 166, 167, 216, 169, 342, 171, 172, 173, 174, 198, 176, 177, 178, 179, 8220, 181, 182, 183, 248, 185, 343, 187, 188, 189, 190, 230, 260, 302, 256, 262, 196, 197, 280, 274, 268, 201, 377, 278, 290, 310, 298, 315, 352, 323, 325, 211, 332, 213, 214, 215, 370, 321, 346, 362, 220, 379, 381, 223, 261, 303, 257, 263, 228, 229, 281, 275, 269, 233, 378, 279, 291, 311, 299, 316, 353, 324, 326, 243, 333, 245, 246, 247, 371, 322, 347, 363, 252, 380, 382, 8217],
|
|
168
|
+
"iso-8859-14": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 7682, 7683, 163, 266, 267, 7690, 167, 7808, 169, 7810, 7691, 7922, 173, 174, 376, 7710, 7711, 288, 289, 7744, 7745, 182, 7766, 7809, 7767, 7811, 7776, 7923, 7812, 7813, 7777, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 372, 209, 210, 211, 212, 213, 214, 7786, 216, 217, 218, 219, 220, 221, 374, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 373, 241, 242, 243, 244, 245, 246, 7787, 248, 249, 250, 251, 252, 253, 375, 255],
|
|
169
|
+
"iso-8859-15": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 8364, 165, 352, 167, 353, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 381, 181, 182, 183, 382, 185, 186, 187, 338, 339, 376, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255],
|
|
170
|
+
"iso-8859-16": [128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 260, 261, 321, 8364, 8222, 352, 167, 353, 169, 536, 171, 377, 173, 378, 379, 176, 177, 268, 322, 381, 8221, 182, 183, 382, 269, 537, 187, 338, 339, 376, 380, 192, 193, 194, 258, 196, 262, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 272, 323, 210, 211, 212, 336, 214, 346, 368, 217, 218, 219, 220, 280, 538, 223, 224, 225, 226, 259, 228, 263, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 273, 324, 242, 243, 244, 337, 246, 347, 369, 249, 250, 251, 252, 281, 539, 255],
|
|
171
|
+
"koi8-r": [9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 8992, 9632, 8729, 8730, 8776, 8804, 8805, 160, 8993, 176, 178, 183, 247, 9552, 9553, 9554, 1105, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 1025, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 169, 1102, 1072, 1073, 1094, 1076, 1077, 1092, 1075, 1093, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1103, 1088, 1089, 1090, 1091, 1078, 1074, 1100, 1099, 1079, 1096, 1101, 1097, 1095, 1098, 1070, 1040, 1041, 1062, 1044, 1045, 1060, 1043, 1061, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1071, 1056, 1057, 1058, 1059, 1046, 1042, 1068, 1067, 1047, 1064, 1069, 1065, 1063, 1066],
|
|
172
|
+
"koi8-u": [9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 8992, 9632, 8729, 8730, 8776, 8804, 8805, 160, 8993, 176, 178, 183, 247, 9552, 9553, 9554, 1105, 1108, 9556, 1110, 1111, 9559, 9560, 9561, 9562, 9563, 1169, 1118, 9566, 9567, 9568, 9569, 1025, 1028, 9571, 1030, 1031, 9574, 9575, 9576, 9577, 9578, 1168, 1038, 169, 1102, 1072, 1073, 1094, 1076, 1077, 1092, 1075, 1093, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1103, 1088, 1089, 1090, 1091, 1078, 1074, 1100, 1099, 1079, 1096, 1101, 1097, 1095, 1098, 1070, 1040, 1041, 1062, 1044, 1045, 1060, 1043, 1061, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1071, 1056, 1057, 1058, 1059, 1046, 1042, 1068, 1067, 1047, 1064, 1069, 1065, 1063, 1066],
|
|
173
|
+
"macintosh": [196, 197, 199, 201, 209, 214, 220, 225, 224, 226, 228, 227, 229, 231, 233, 232, 234, 235, 237, 236, 238, 239, 241, 243, 242, 244, 246, 245, 250, 249, 251, 252, 8224, 176, 162, 163, 167, 8226, 182, 223, 174, 169, 8482, 180, 168, 8800, 198, 216, 8734, 177, 8804, 8805, 165, 181, 8706, 8721, 8719, 960, 8747, 170, 186, 937, 230, 248, 191, 161, 172, 8730, 402, 8776, 8710, 171, 187, 8230, 160, 192, 195, 213, 338, 339, 8211, 8212, 8220, 8221, 8216, 8217, 247, 9674, 255, 376, 8260, 8364, 8249, 8250, 64257, 64258, 8225, 183, 8218, 8222, 8240, 194, 202, 193, 203, 200, 205, 206, 207, 204, 211, 212, 63743, 210, 218, 219, 217, 305, 710, 732, 175, 728, 729, 730, 184, 733, 731, 711],
|
|
174
|
+
"windows-874": [8364, 129, 130, 131, 132, 8230, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 153, 154, 155, 156, 157, 158, 159, 160, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634, 3635, 3636, 3637, 3638, 3639, 3640, 3641, 3642, null, null, null, null, 3647, 3648, 3649, 3650, 3651, 3652, 3653, 3654, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662, 3663, 3664, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, null, null, null, null],
|
|
175
|
+
"windows-1250": [8364, 129, 8218, 131, 8222, 8230, 8224, 8225, 136, 8240, 352, 8249, 346, 356, 381, 377, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 353, 8250, 347, 357, 382, 378, 160, 711, 728, 321, 164, 260, 166, 167, 168, 169, 350, 171, 172, 173, 174, 379, 176, 177, 731, 322, 180, 181, 182, 183, 184, 261, 351, 187, 317, 733, 318, 380, 340, 193, 194, 258, 196, 313, 262, 199, 268, 201, 280, 203, 282, 205, 206, 270, 272, 323, 327, 211, 212, 336, 214, 215, 344, 366, 218, 368, 220, 221, 354, 223, 341, 225, 226, 259, 228, 314, 263, 231, 269, 233, 281, 235, 283, 237, 238, 271, 273, 324, 328, 243, 244, 337, 246, 247, 345, 367, 250, 369, 252, 253, 355, 729],
|
|
176
|
+
"windows-1251": [1026, 1027, 8218, 1107, 8222, 8230, 8224, 8225, 8364, 8240, 1033, 8249, 1034, 1036, 1035, 1039, 1106, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 1113, 8250, 1114, 1116, 1115, 1119, 160, 1038, 1118, 1032, 164, 1168, 166, 167, 1025, 169, 1028, 171, 172, 173, 174, 1031, 176, 177, 1030, 1110, 1169, 181, 182, 183, 1105, 8470, 1108, 187, 1112, 1029, 1109, 1111, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103],
|
|
177
|
+
"windows-1252": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 382, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255],
|
|
178
|
+
"windows-1253": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 136, 8240, 138, 8249, 140, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 154, 8250, 156, 157, 158, 159, 160, 901, 902, 163, 164, 165, 166, 167, 168, 169, null, 171, 172, 173, 174, 8213, 176, 177, 178, 179, 900, 181, 182, 183, 904, 905, 906, 187, 908, 189, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, null, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, null],
|
|
179
|
+
"windows-1254": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, 157, 158, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 286, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 304, 350, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 287, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 305, 351, 255],
|
|
180
|
+
"windows-1255": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 138, 8249, 140, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 154, 8250, 156, 157, 158, 159, 160, 161, 162, 163, 8362, 165, 166, 167, 168, 169, 215, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 247, 187, 188, 189, 190, 191, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1520, 1521, 1522, 1523, 1524, null, null, null, null, null, null, null, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, null, null, 8206, 8207, null],
|
|
181
|
+
"windows-1256": [8364, 1662, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 1657, 8249, 338, 1670, 1688, 1672, 1711, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 1705, 8482, 1681, 8250, 339, 8204, 8205, 1722, 160, 1548, 162, 163, 164, 165, 166, 167, 168, 169, 1726, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 1563, 187, 188, 189, 190, 1567, 1729, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 215, 1591, 1592, 1593, 1594, 1600, 1601, 1602, 1603, 224, 1604, 226, 1605, 1606, 1607, 1608, 231, 232, 233, 234, 235, 1609, 1610, 238, 239, 1611, 1612, 1613, 1614, 244, 1615, 1616, 247, 1617, 249, 1618, 251, 252, 8206, 8207, 1746],
|
|
182
|
+
"windows-1257": [8364, 129, 8218, 131, 8222, 8230, 8224, 8225, 136, 8240, 138, 8249, 140, 168, 711, 184, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 152, 8482, 154, 8250, 156, 175, 731, 159, 160, null, 162, 163, 164, null, 166, 167, 216, 169, 342, 171, 172, 173, 174, 198, 176, 177, 178, 179, 180, 181, 182, 183, 248, 185, 343, 187, 188, 189, 190, 230, 260, 302, 256, 262, 196, 197, 280, 274, 268, 201, 377, 278, 290, 310, 298, 315, 352, 323, 325, 211, 332, 213, 214, 215, 370, 321, 346, 362, 220, 379, 381, 223, 261, 303, 257, 263, 228, 229, 281, 275, 269, 233, 378, 279, 291, 311, 299, 316, 353, 324, 326, 243, 333, 245, 246, 247, 371, 322, 347, 363, 252, 380, 382, 729],
|
|
183
|
+
"windows-1258": [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 138, 8249, 338, 141, 142, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 154, 8250, 339, 157, 158, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 258, 196, 197, 198, 199, 200, 201, 202, 203, 768, 205, 206, 207, 272, 209, 777, 211, 212, 416, 214, 215, 216, 217, 218, 219, 220, 431, 771, 223, 224, 225, 226, 259, 228, 229, 230, 231, 232, 233, 234, 235, 769, 237, 238, 239, 273, 241, 803, 243, 244, 417, 246, 247, 248, 249, 250, 251, 252, 432, 8363, 255],
|
|
184
|
+
"x-mac-cyrillic": [1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 8224, 176, 1168, 163, 167, 8226, 182, 1030, 174, 169, 8482, 1026, 1106, 8800, 1027, 1107, 8734, 177, 8804, 8805, 1110, 181, 1169, 1032, 1028, 1108, 1031, 1111, 1033, 1113, 1034, 1114, 1112, 1029, 172, 8730, 402, 8776, 8710, 171, 187, 8230, 160, 1035, 1115, 1036, 1116, 1109, 8211, 8212, 8220, 8221, 8216, 8217, 247, 8222, 1038, 1118, 1039, 1119, 8470, 1025, 1105, 1103, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 8364]
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/polyfills/text-encoder/text-encoder.ts
|
|
188
|
+
globalThis["encoding-indexes"] = encoding_indexes_default || {};
|
|
189
|
+
function inRange(a, min, max) {
|
|
190
|
+
return min <= a && a <= max;
|
|
191
|
+
}
|
|
192
|
+
function includes(array, item) {
|
|
193
|
+
return array.indexOf(item) !== -1;
|
|
194
|
+
}
|
|
195
|
+
var floor = Math.floor;
|
|
196
|
+
function ToDictionary(o) {
|
|
197
|
+
if (o === void 0) return {};
|
|
198
|
+
if (o === Object(o)) return o;
|
|
199
|
+
throw TypeError("Could not convert argument to dictionary");
|
|
200
|
+
}
|
|
201
|
+
function stringToCodePoints(string) {
|
|
202
|
+
var s = String(string);
|
|
203
|
+
var n = s.length;
|
|
204
|
+
var i = 0;
|
|
205
|
+
var u = [];
|
|
206
|
+
while (i < n) {
|
|
207
|
+
var c = s.charCodeAt(i);
|
|
208
|
+
if (c < 55296 || c > 57343) {
|
|
209
|
+
u.push(c);
|
|
210
|
+
} else if (56320 <= c && c <= 57343) {
|
|
211
|
+
u.push(65533);
|
|
212
|
+
} else if (55296 <= c && c <= 56319) {
|
|
213
|
+
if (i === n - 1) {
|
|
214
|
+
u.push(65533);
|
|
215
|
+
} else {
|
|
216
|
+
var d = s.charCodeAt(i + 1);
|
|
217
|
+
if (56320 <= d && d <= 57343) {
|
|
218
|
+
var a = c & 1023;
|
|
219
|
+
var b = d & 1023;
|
|
220
|
+
u.push(65536 + (a << 10) + b);
|
|
221
|
+
i += 1;
|
|
222
|
+
} else {
|
|
223
|
+
u.push(65533);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
i += 1;
|
|
228
|
+
}
|
|
229
|
+
return u;
|
|
230
|
+
}
|
|
231
|
+
function codePointsToString(code_points) {
|
|
232
|
+
var s = "";
|
|
233
|
+
for (var i = 0; i < code_points.length; ++i) {
|
|
234
|
+
var cp = code_points[i];
|
|
235
|
+
if (cp <= 65535) {
|
|
236
|
+
s += String.fromCharCode(cp);
|
|
237
|
+
} else {
|
|
238
|
+
cp -= 65536;
|
|
239
|
+
s += String.fromCharCode((cp >> 10) + 55296, (cp & 1023) + 56320);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return s;
|
|
243
|
+
}
|
|
244
|
+
function isASCIIByte(a) {
|
|
245
|
+
return 0 <= a && a <= 127;
|
|
246
|
+
}
|
|
247
|
+
var isASCIICodePoint = isASCIIByte;
|
|
248
|
+
var end_of_stream = -1;
|
|
249
|
+
function Stream(tokens) {
|
|
250
|
+
this.tokens = [].slice.call(tokens);
|
|
251
|
+
this.tokens.reverse();
|
|
252
|
+
}
|
|
253
|
+
Stream.prototype = {
|
|
254
|
+
/**
|
|
255
|
+
* @return {boolean} True if end-of-stream has been hit.
|
|
256
|
+
*/
|
|
257
|
+
endOfStream: function() {
|
|
258
|
+
return !this.tokens.length;
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* When a token is read from a stream, the first token in the
|
|
262
|
+
* stream must be returned and subsequently removed, and
|
|
263
|
+
* end-of-stream must be returned otherwise.
|
|
264
|
+
*
|
|
265
|
+
* @return {number} Get the next token from the stream, or
|
|
266
|
+
* end_of_stream.
|
|
267
|
+
*/
|
|
268
|
+
read: function() {
|
|
269
|
+
if (!this.tokens.length) return end_of_stream;
|
|
270
|
+
return this.tokens.pop();
|
|
271
|
+
},
|
|
272
|
+
/**
|
|
273
|
+
* When one or more tokens are prepended to a stream, those tokens
|
|
274
|
+
* must be inserted, in given order, before the first token in the
|
|
275
|
+
* stream.
|
|
276
|
+
*
|
|
277
|
+
* @param {(number|!Array.<number>)} token The token(s) to prepend to the
|
|
278
|
+
* stream.
|
|
279
|
+
*/
|
|
280
|
+
prepend: function(token) {
|
|
281
|
+
if (Array.isArray(token)) {
|
|
282
|
+
var tokens = (
|
|
283
|
+
/**@type {!Array.<number>}*/
|
|
284
|
+
token
|
|
285
|
+
);
|
|
286
|
+
while (tokens.length) this.tokens.push(tokens.pop());
|
|
287
|
+
} else {
|
|
288
|
+
this.tokens.push(token);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
/**
|
|
292
|
+
* When one or more tokens are pushed to a stream, those tokens
|
|
293
|
+
* must be inserted, in given order, after the last token in the
|
|
294
|
+
* stream.
|
|
295
|
+
*
|
|
296
|
+
* @param {(number|!Array.<number>)} token The tokens(s) to push to the
|
|
297
|
+
* stream.
|
|
298
|
+
*/
|
|
299
|
+
push: function(token) {
|
|
300
|
+
if (Array.isArray(token)) {
|
|
301
|
+
var tokens = (
|
|
302
|
+
/**@type {!Array.<number>}*/
|
|
303
|
+
token
|
|
304
|
+
);
|
|
305
|
+
while (tokens.length) this.tokens.unshift(tokens.shift());
|
|
306
|
+
} else {
|
|
307
|
+
this.tokens.unshift(token);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
var finished = -1;
|
|
312
|
+
function decoderError(fatal, opt_code_point) {
|
|
313
|
+
if (fatal) throw TypeError("Decoder error");
|
|
314
|
+
return opt_code_point || 65533;
|
|
315
|
+
}
|
|
316
|
+
function encoderError(code_point) {
|
|
317
|
+
throw TypeError("The code point " + code_point + " could not be encoded.");
|
|
318
|
+
}
|
|
319
|
+
function Decoder() {
|
|
320
|
+
}
|
|
321
|
+
Decoder.prototype = {
|
|
322
|
+
/**
|
|
323
|
+
* @param {Stream} stream The stream of bytes being decoded.
|
|
324
|
+
* @param {number} bite The next byte read from the stream.
|
|
325
|
+
* @return {?(number|!Array.<number>)} The next code point(s)
|
|
326
|
+
* decoded, or null if not enough data exists in the input
|
|
327
|
+
* stream to decode a complete code point, or |finished|.
|
|
328
|
+
*/
|
|
329
|
+
handler: function(stream2, bite) {
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
function Encoder() {
|
|
333
|
+
}
|
|
334
|
+
Encoder.prototype = {
|
|
335
|
+
/**
|
|
336
|
+
* @param {Stream} stream The stream of code points being encoded.
|
|
337
|
+
* @param {number} code_point Next code point read from the stream.
|
|
338
|
+
* @return {(number|!Array.<number>)} Byte(s) to emit, or |finished|.
|
|
339
|
+
*/
|
|
340
|
+
handler: function(stream2, code_point) {
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
function getEncoding(label) {
|
|
344
|
+
label = String(label).trim().toLowerCase();
|
|
345
|
+
if (Object.prototype.hasOwnProperty.call(label_to_encoding, label)) {
|
|
346
|
+
return label_to_encoding[label];
|
|
347
|
+
}
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
var encodings = [
|
|
351
|
+
{
|
|
352
|
+
encodings: [
|
|
353
|
+
{
|
|
354
|
+
labels: ["unicode-1-1-utf-8", "utf-8", "utf8"],
|
|
355
|
+
name: "UTF-8"
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
heading: "The Encoding"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
encodings: [
|
|
362
|
+
{
|
|
363
|
+
labels: ["866", "cp866", "csibm866", "ibm866"],
|
|
364
|
+
name: "IBM866"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
labels: [
|
|
368
|
+
"csisolatin2",
|
|
369
|
+
"iso-8859-2",
|
|
370
|
+
"iso-ir-101",
|
|
371
|
+
"iso8859-2",
|
|
372
|
+
"iso88592",
|
|
373
|
+
"iso_8859-2",
|
|
374
|
+
"iso_8859-2:1987",
|
|
375
|
+
"l2",
|
|
376
|
+
"latin2"
|
|
377
|
+
],
|
|
378
|
+
name: "ISO-8859-2"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
labels: [
|
|
382
|
+
"csisolatin3",
|
|
383
|
+
"iso-8859-3",
|
|
384
|
+
"iso-ir-109",
|
|
385
|
+
"iso8859-3",
|
|
386
|
+
"iso88593",
|
|
387
|
+
"iso_8859-3",
|
|
388
|
+
"iso_8859-3:1988",
|
|
389
|
+
"l3",
|
|
390
|
+
"latin3"
|
|
391
|
+
],
|
|
392
|
+
name: "ISO-8859-3"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
labels: [
|
|
396
|
+
"csisolatin4",
|
|
397
|
+
"iso-8859-4",
|
|
398
|
+
"iso-ir-110",
|
|
399
|
+
"iso8859-4",
|
|
400
|
+
"iso88594",
|
|
401
|
+
"iso_8859-4",
|
|
402
|
+
"iso_8859-4:1988",
|
|
403
|
+
"l4",
|
|
404
|
+
"latin4"
|
|
405
|
+
],
|
|
406
|
+
name: "ISO-8859-4"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
labels: [
|
|
410
|
+
"csisolatincyrillic",
|
|
411
|
+
"cyrillic",
|
|
412
|
+
"iso-8859-5",
|
|
413
|
+
"iso-ir-144",
|
|
414
|
+
"iso8859-5",
|
|
415
|
+
"iso88595",
|
|
416
|
+
"iso_8859-5",
|
|
417
|
+
"iso_8859-5:1988"
|
|
418
|
+
],
|
|
419
|
+
name: "ISO-8859-5"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
labels: [
|
|
423
|
+
"arabic",
|
|
424
|
+
"asmo-708",
|
|
425
|
+
"csiso88596e",
|
|
426
|
+
"csiso88596i",
|
|
427
|
+
"csisolatinarabic",
|
|
428
|
+
"ecma-114",
|
|
429
|
+
"iso-8859-6",
|
|
430
|
+
"iso-8859-6-e",
|
|
431
|
+
"iso-8859-6-i",
|
|
432
|
+
"iso-ir-127",
|
|
433
|
+
"iso8859-6",
|
|
434
|
+
"iso88596",
|
|
435
|
+
"iso_8859-6",
|
|
436
|
+
"iso_8859-6:1987"
|
|
437
|
+
],
|
|
438
|
+
name: "ISO-8859-6"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
labels: [
|
|
442
|
+
"csisolatingreek",
|
|
443
|
+
"ecma-118",
|
|
444
|
+
"elot_928",
|
|
445
|
+
"greek",
|
|
446
|
+
"greek8",
|
|
447
|
+
"iso-8859-7",
|
|
448
|
+
"iso-ir-126",
|
|
449
|
+
"iso8859-7",
|
|
450
|
+
"iso88597",
|
|
451
|
+
"iso_8859-7",
|
|
452
|
+
"iso_8859-7:1987",
|
|
453
|
+
"sun_eu_greek"
|
|
454
|
+
],
|
|
455
|
+
name: "ISO-8859-7"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
labels: [
|
|
459
|
+
"csiso88598e",
|
|
460
|
+
"csisolatinhebrew",
|
|
461
|
+
"hebrew",
|
|
462
|
+
"iso-8859-8",
|
|
463
|
+
"iso-8859-8-e",
|
|
464
|
+
"iso-ir-138",
|
|
465
|
+
"iso8859-8",
|
|
466
|
+
"iso88598",
|
|
467
|
+
"iso_8859-8",
|
|
468
|
+
"iso_8859-8:1988",
|
|
469
|
+
"visual"
|
|
470
|
+
],
|
|
471
|
+
name: "ISO-8859-8"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
labels: ["csiso88598i", "iso-8859-8-i", "logical"],
|
|
475
|
+
name: "ISO-8859-8-I"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
labels: [
|
|
479
|
+
"csisolatin6",
|
|
480
|
+
"iso-8859-10",
|
|
481
|
+
"iso-ir-157",
|
|
482
|
+
"iso8859-10",
|
|
483
|
+
"iso885910",
|
|
484
|
+
"l6",
|
|
485
|
+
"latin6"
|
|
486
|
+
],
|
|
487
|
+
name: "ISO-8859-10"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
labels: ["iso-8859-13", "iso8859-13", "iso885913"],
|
|
491
|
+
name: "ISO-8859-13"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
labels: ["iso-8859-14", "iso8859-14", "iso885914"],
|
|
495
|
+
name: "ISO-8859-14"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
labels: ["csisolatin9", "iso-8859-15", "iso8859-15", "iso885915", "iso_8859-15", "l9"],
|
|
499
|
+
name: "ISO-8859-15"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
labels: ["iso-8859-16"],
|
|
503
|
+
name: "ISO-8859-16"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
labels: ["cskoi8r", "koi", "koi8", "koi8-r", "koi8_r"],
|
|
507
|
+
name: "KOI8-R"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
labels: ["koi8-ru", "koi8-u"],
|
|
511
|
+
name: "KOI8-U"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
labels: ["csmacintosh", "mac", "macintosh", "x-mac-roman"],
|
|
515
|
+
name: "macintosh"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
labels: ["dos-874", "iso-8859-11", "iso8859-11", "iso885911", "tis-620", "windows-874"],
|
|
519
|
+
name: "windows-874"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
labels: ["cp1250", "windows-1250", "x-cp1250"],
|
|
523
|
+
name: "windows-1250"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
labels: ["cp1251", "windows-1251", "x-cp1251"],
|
|
527
|
+
name: "windows-1251"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
labels: [
|
|
531
|
+
"ansi_x3.4-1968",
|
|
532
|
+
"ascii",
|
|
533
|
+
"cp1252",
|
|
534
|
+
"cp819",
|
|
535
|
+
"csisolatin1",
|
|
536
|
+
"ibm819",
|
|
537
|
+
"iso-8859-1",
|
|
538
|
+
"iso-ir-100",
|
|
539
|
+
"iso8859-1",
|
|
540
|
+
"iso88591",
|
|
541
|
+
"iso_8859-1",
|
|
542
|
+
"iso_8859-1:1987",
|
|
543
|
+
"l1",
|
|
544
|
+
"latin1",
|
|
545
|
+
"us-ascii",
|
|
546
|
+
"windows-1252",
|
|
547
|
+
"x-cp1252"
|
|
548
|
+
],
|
|
549
|
+
name: "windows-1252"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
labels: ["cp1253", "windows-1253", "x-cp1253"],
|
|
553
|
+
name: "windows-1253"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
labels: [
|
|
557
|
+
"cp1254",
|
|
558
|
+
"csisolatin5",
|
|
559
|
+
"iso-8859-9",
|
|
560
|
+
"iso-ir-148",
|
|
561
|
+
"iso8859-9",
|
|
562
|
+
"iso88599",
|
|
563
|
+
"iso_8859-9",
|
|
564
|
+
"iso_8859-9:1989",
|
|
565
|
+
"l5",
|
|
566
|
+
"latin5",
|
|
567
|
+
"windows-1254",
|
|
568
|
+
"x-cp1254"
|
|
569
|
+
],
|
|
570
|
+
name: "windows-1254"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
labels: ["cp1255", "windows-1255", "x-cp1255"],
|
|
574
|
+
name: "windows-1255"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
labels: ["cp1256", "windows-1256", "x-cp1256"],
|
|
578
|
+
name: "windows-1256"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
labels: ["cp1257", "windows-1257", "x-cp1257"],
|
|
582
|
+
name: "windows-1257"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
labels: ["cp1258", "windows-1258", "x-cp1258"],
|
|
586
|
+
name: "windows-1258"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
labels: ["x-mac-cyrillic", "x-mac-ukrainian"],
|
|
590
|
+
name: "x-mac-cyrillic"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
heading: "Legacy single-byte encodings"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
encodings: [
|
|
597
|
+
{
|
|
598
|
+
labels: [
|
|
599
|
+
"chinese",
|
|
600
|
+
"csgb2312",
|
|
601
|
+
"csiso58gb231280",
|
|
602
|
+
"gb2312",
|
|
603
|
+
"gb_2312",
|
|
604
|
+
"gb_2312-80",
|
|
605
|
+
"gbk",
|
|
606
|
+
"iso-ir-58",
|
|
607
|
+
"x-gbk"
|
|
608
|
+
],
|
|
609
|
+
name: "GBK"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
labels: ["gb18030"],
|
|
613
|
+
name: "gb18030"
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
heading: "Legacy multi-byte Chinese (simplified) encodings"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
encodings: [
|
|
620
|
+
{
|
|
621
|
+
labels: ["big5", "big5-hkscs", "cn-big5", "csbig5", "x-x-big5"],
|
|
622
|
+
name: "Big5"
|
|
623
|
+
}
|
|
624
|
+
],
|
|
625
|
+
heading: "Legacy multi-byte Chinese (traditional) encodings"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
encodings: [
|
|
629
|
+
{
|
|
630
|
+
labels: ["cseucpkdfmtjapanese", "euc-jp", "x-euc-jp"],
|
|
631
|
+
name: "EUC-JP"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
labels: ["csiso2022jp", "iso-2022-jp"],
|
|
635
|
+
name: "ISO-2022-JP"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
labels: [
|
|
639
|
+
"csshiftjis",
|
|
640
|
+
"ms932",
|
|
641
|
+
"ms_kanji",
|
|
642
|
+
"shift-jis",
|
|
643
|
+
"shift_jis",
|
|
644
|
+
"sjis",
|
|
645
|
+
"windows-31j",
|
|
646
|
+
"x-sjis"
|
|
647
|
+
],
|
|
648
|
+
name: "Shift_JIS"
|
|
649
|
+
}
|
|
650
|
+
],
|
|
651
|
+
heading: "Legacy multi-byte Japanese encodings"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
encodings: [
|
|
655
|
+
{
|
|
656
|
+
labels: [
|
|
657
|
+
"cseuckr",
|
|
658
|
+
"csksc56011987",
|
|
659
|
+
"euc-kr",
|
|
660
|
+
"iso-ir-149",
|
|
661
|
+
"korean",
|
|
662
|
+
"ks_c_5601-1987",
|
|
663
|
+
"ks_c_5601-1989",
|
|
664
|
+
"ksc5601",
|
|
665
|
+
"ksc_5601",
|
|
666
|
+
"windows-949"
|
|
667
|
+
],
|
|
668
|
+
name: "EUC-KR"
|
|
669
|
+
}
|
|
670
|
+
],
|
|
671
|
+
heading: "Legacy multi-byte Korean encodings"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
encodings: [
|
|
675
|
+
{
|
|
676
|
+
labels: ["csiso2022kr", "hz-gb-2312", "iso-2022-cn", "iso-2022-cn-ext", "iso-2022-kr"],
|
|
677
|
+
name: "replacement"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
labels: ["utf-16be"],
|
|
681
|
+
name: "UTF-16BE"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
labels: ["utf-16", "utf-16le"],
|
|
685
|
+
name: "UTF-16LE"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
labels: ["x-user-defined"],
|
|
689
|
+
name: "x-user-defined"
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
heading: "Legacy miscellaneous encodings"
|
|
693
|
+
}
|
|
694
|
+
];
|
|
695
|
+
var label_to_encoding = {};
|
|
696
|
+
encodings.forEach(function(category) {
|
|
697
|
+
category.encodings.forEach(function(encoding) {
|
|
698
|
+
encoding.labels.forEach(function(label) {
|
|
699
|
+
label_to_encoding[label] = encoding;
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
});
|
|
703
|
+
var encoders = {};
|
|
704
|
+
var decoders = {};
|
|
705
|
+
function indexCodePointFor(pointer, index2) {
|
|
706
|
+
if (!index2) return null;
|
|
707
|
+
return index2[pointer] || null;
|
|
708
|
+
}
|
|
709
|
+
function indexPointerFor(code_point, index2) {
|
|
710
|
+
var pointer = index2.indexOf(code_point);
|
|
711
|
+
return pointer === -1 ? null : pointer;
|
|
712
|
+
}
|
|
713
|
+
function index(name) {
|
|
714
|
+
if (!("encoding-indexes" in globalThis)) {
|
|
715
|
+
throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");
|
|
716
|
+
}
|
|
717
|
+
return globalThis["encoding-indexes"][name];
|
|
718
|
+
}
|
|
719
|
+
function indexGB18030RangesCodePointFor(pointer) {
|
|
720
|
+
if (pointer > 39419 && pointer < 189e3 || pointer > 1237575) return null;
|
|
721
|
+
if (pointer === 7457) return 59335;
|
|
722
|
+
var offset = 0;
|
|
723
|
+
var code_point_offset = 0;
|
|
724
|
+
var idx = index("gb18030-ranges");
|
|
725
|
+
var i;
|
|
726
|
+
for (i = 0; i < idx.length; ++i) {
|
|
727
|
+
var entry = idx[i];
|
|
728
|
+
if (entry[0] <= pointer) {
|
|
729
|
+
offset = entry[0];
|
|
730
|
+
code_point_offset = entry[1];
|
|
731
|
+
} else {
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return code_point_offset + pointer - offset;
|
|
736
|
+
}
|
|
737
|
+
function indexGB18030RangesPointerFor(code_point) {
|
|
738
|
+
if (code_point === 59335) return 7457;
|
|
739
|
+
var offset = 0;
|
|
740
|
+
var pointer_offset = 0;
|
|
741
|
+
var idx = index("gb18030-ranges");
|
|
742
|
+
var i;
|
|
743
|
+
for (i = 0; i < idx.length; ++i) {
|
|
744
|
+
var entry = idx[i];
|
|
745
|
+
if (entry[1] <= code_point) {
|
|
746
|
+
offset = entry[1];
|
|
747
|
+
pointer_offset = entry[0];
|
|
748
|
+
} else {
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return pointer_offset + code_point - offset;
|
|
753
|
+
}
|
|
754
|
+
function indexShiftJISPointerFor(code_point) {
|
|
755
|
+
shift_jis_index = shift_jis_index || index("jis0208").map(function(code_point2, pointer) {
|
|
756
|
+
return inRange(pointer, 8272, 8835) ? null : code_point2;
|
|
757
|
+
});
|
|
758
|
+
var index_ = shift_jis_index;
|
|
759
|
+
return index_.indexOf(code_point);
|
|
760
|
+
}
|
|
761
|
+
var shift_jis_index;
|
|
762
|
+
function indexBig5PointerFor(code_point) {
|
|
763
|
+
big5_index_no_hkscs = big5_index_no_hkscs || index("big5").map(function(code_point2, pointer) {
|
|
764
|
+
return pointer < (161 - 129) * 157 ? null : code_point2;
|
|
765
|
+
});
|
|
766
|
+
var index_ = big5_index_no_hkscs;
|
|
767
|
+
if (code_point === 9552 || code_point === 9566 || code_point === 9569 || code_point === 9578 || code_point === 21313 || code_point === 21317) {
|
|
768
|
+
return index_.lastIndexOf(code_point);
|
|
769
|
+
}
|
|
770
|
+
return indexPointerFor(code_point, index_);
|
|
771
|
+
}
|
|
772
|
+
var big5_index_no_hkscs;
|
|
773
|
+
var DEFAULT_ENCODING = "utf-8";
|
|
774
|
+
function TextDecoder2(label, options) {
|
|
775
|
+
if (!(this instanceof TextDecoder2))
|
|
776
|
+
throw TypeError("Called as a function. Did you forget 'new'?");
|
|
777
|
+
label = label !== void 0 ? String(label) : DEFAULT_ENCODING;
|
|
778
|
+
options = ToDictionary(options);
|
|
779
|
+
this._encoding = null;
|
|
780
|
+
this._decoder = null;
|
|
781
|
+
this._ignoreBOM = false;
|
|
782
|
+
this._BOMseen = false;
|
|
783
|
+
this._error_mode = "replacement";
|
|
784
|
+
this._do_not_flush = false;
|
|
785
|
+
var encoding = getEncoding(label);
|
|
786
|
+
if (encoding === null || encoding.name === "replacement")
|
|
787
|
+
throw RangeError("Unknown encoding: " + label);
|
|
788
|
+
if (!decoders[encoding.name]) {
|
|
789
|
+
throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");
|
|
790
|
+
}
|
|
791
|
+
var dec = this;
|
|
792
|
+
dec._encoding = encoding;
|
|
793
|
+
if (Boolean(options["fatal"])) dec._error_mode = "fatal";
|
|
794
|
+
if (Boolean(options["ignoreBOM"])) dec._ignoreBOM = true;
|
|
795
|
+
if (!Object.defineProperty) {
|
|
796
|
+
this.encoding = dec._encoding.name.toLowerCase();
|
|
797
|
+
this.fatal = dec._error_mode === "fatal";
|
|
798
|
+
this.ignoreBOM = dec._ignoreBOM;
|
|
799
|
+
}
|
|
800
|
+
return dec;
|
|
801
|
+
}
|
|
802
|
+
if (Object.defineProperty) {
|
|
803
|
+
Object.defineProperty(TextDecoder2.prototype, "encoding", {
|
|
804
|
+
/** @this {TextDecoder} */
|
|
805
|
+
get: function() {
|
|
806
|
+
return this._encoding.name.toLowerCase();
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
Object.defineProperty(TextDecoder2.prototype, "fatal", {
|
|
810
|
+
/** @this {TextDecoder} */
|
|
811
|
+
get: function() {
|
|
812
|
+
return this._error_mode === "fatal";
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
Object.defineProperty(TextDecoder2.prototype, "ignoreBOM", {
|
|
816
|
+
/** @this {TextDecoder} */
|
|
817
|
+
get: function() {
|
|
818
|
+
return this._ignoreBOM;
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
TextDecoder2.prototype.decode = function decode(input, options) {
|
|
823
|
+
var bytes;
|
|
824
|
+
if (typeof input === "object" && input instanceof ArrayBuffer) {
|
|
825
|
+
bytes = new Uint8Array(input);
|
|
826
|
+
} else if (typeof input === "object" && "buffer" in input && input.buffer instanceof ArrayBuffer) {
|
|
827
|
+
bytes = new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
|
|
828
|
+
} else {
|
|
829
|
+
bytes = new Uint8Array(0);
|
|
830
|
+
}
|
|
831
|
+
options = ToDictionary(options);
|
|
832
|
+
if (!this._do_not_flush) {
|
|
833
|
+
this._decoder = decoders[this._encoding.name]({
|
|
834
|
+
fatal: this._error_mode === "fatal"
|
|
835
|
+
});
|
|
836
|
+
this._BOMseen = false;
|
|
837
|
+
}
|
|
838
|
+
this._do_not_flush = Boolean(options["stream"]);
|
|
839
|
+
var input_stream = new Stream(bytes);
|
|
840
|
+
var output = [];
|
|
841
|
+
var result;
|
|
842
|
+
while (true) {
|
|
843
|
+
var token = input_stream.read();
|
|
844
|
+
if (token === end_of_stream) break;
|
|
845
|
+
result = this._decoder.handler(input_stream, token);
|
|
846
|
+
if (result === finished) break;
|
|
847
|
+
if (result !== null) {
|
|
848
|
+
if (Array.isArray(result)) output.push.apply(
|
|
849
|
+
output,
|
|
850
|
+
/**@type {!Array.<number>}*/
|
|
851
|
+
result
|
|
852
|
+
);
|
|
853
|
+
else output.push(result);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (!this._do_not_flush) {
|
|
857
|
+
do {
|
|
858
|
+
result = this._decoder.handler(input_stream, input_stream.read());
|
|
859
|
+
if (result === finished) break;
|
|
860
|
+
if (result === null) continue;
|
|
861
|
+
if (Array.isArray(result)) output.push.apply(
|
|
862
|
+
output,
|
|
863
|
+
/**@type {!Array.<number>}*/
|
|
864
|
+
result
|
|
865
|
+
);
|
|
866
|
+
else output.push(result);
|
|
867
|
+
} while (!input_stream.endOfStream());
|
|
868
|
+
this._decoder = null;
|
|
869
|
+
}
|
|
870
|
+
function serializeStream(stream2) {
|
|
871
|
+
if (includes(["UTF-8", "UTF-16LE", "UTF-16BE"], this._encoding.name) && !this._ignoreBOM && !this._BOMseen) {
|
|
872
|
+
if (stream2.length > 0 && stream2[0] === 65279) {
|
|
873
|
+
this._BOMseen = true;
|
|
874
|
+
stream2.shift();
|
|
875
|
+
} else if (stream2.length > 0) {
|
|
876
|
+
this._BOMseen = true;
|
|
877
|
+
} else {
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
return codePointsToString(stream2);
|
|
881
|
+
}
|
|
882
|
+
return serializeStream.call(this, output);
|
|
883
|
+
};
|
|
884
|
+
function TextEncoder2(label, options) {
|
|
885
|
+
if (!(this instanceof TextEncoder2))
|
|
886
|
+
throw TypeError("Called as a function. Did you forget 'new'?");
|
|
887
|
+
options = ToDictionary(options);
|
|
888
|
+
this._encoding = null;
|
|
889
|
+
this._encoder = null;
|
|
890
|
+
this._do_not_flush = false;
|
|
891
|
+
this._fatal = Boolean(options["fatal"]) ? "fatal" : "replacement";
|
|
892
|
+
var enc = this;
|
|
893
|
+
if (Boolean(options["NONSTANDARD_allowLegacyEncoding"])) {
|
|
894
|
+
label = label !== void 0 ? String(label) : DEFAULT_ENCODING;
|
|
895
|
+
var encoding = getEncoding(label);
|
|
896
|
+
if (encoding === null || encoding.name === "replacement")
|
|
897
|
+
throw RangeError("Unknown encoding: " + label);
|
|
898
|
+
if (!encoders[encoding.name]) {
|
|
899
|
+
throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");
|
|
900
|
+
}
|
|
901
|
+
enc._encoding = encoding;
|
|
902
|
+
} else {
|
|
903
|
+
enc._encoding = getEncoding("utf-8");
|
|
904
|
+
if (label !== void 0 && "console" in globalThis) {
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
if (!Object.defineProperty) this.encoding = enc._encoding.name.toLowerCase();
|
|
908
|
+
return enc;
|
|
909
|
+
}
|
|
910
|
+
if (Object.defineProperty) {
|
|
911
|
+
Object.defineProperty(TextEncoder2.prototype, "encoding", {
|
|
912
|
+
/** @this {TextEncoder} */
|
|
913
|
+
get: function() {
|
|
914
|
+
return this._encoding.name.toLowerCase();
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
TextEncoder2.prototype.encode = function encode(opt_string, options) {
|
|
919
|
+
opt_string = opt_string === void 0 ? "" : String(opt_string);
|
|
920
|
+
options = ToDictionary(options);
|
|
921
|
+
if (!this._do_not_flush)
|
|
922
|
+
this._encoder = encoders[this._encoding.name]({
|
|
923
|
+
fatal: this._fatal === "fatal"
|
|
924
|
+
});
|
|
925
|
+
this._do_not_flush = Boolean(options["stream"]);
|
|
926
|
+
var input = new Stream(stringToCodePoints(opt_string));
|
|
927
|
+
var output = [];
|
|
928
|
+
var result;
|
|
929
|
+
while (true) {
|
|
930
|
+
var token = input.read();
|
|
931
|
+
if (token === end_of_stream) break;
|
|
932
|
+
result = this._encoder.handler(input, token);
|
|
933
|
+
if (result === finished) break;
|
|
934
|
+
if (Array.isArray(result)) output.push.apply(
|
|
935
|
+
output,
|
|
936
|
+
/**@type {!Array.<number>}*/
|
|
937
|
+
result
|
|
938
|
+
);
|
|
939
|
+
else output.push(result);
|
|
940
|
+
}
|
|
941
|
+
if (!this._do_not_flush) {
|
|
942
|
+
while (true) {
|
|
943
|
+
result = this._encoder.handler(input, input.read());
|
|
944
|
+
if (result === finished) break;
|
|
945
|
+
if (Array.isArray(result)) output.push.apply(
|
|
946
|
+
output,
|
|
947
|
+
/**@type {!Array.<number>}*/
|
|
948
|
+
result
|
|
949
|
+
);
|
|
950
|
+
else output.push(result);
|
|
951
|
+
}
|
|
952
|
+
this._encoder = null;
|
|
953
|
+
}
|
|
954
|
+
return new Uint8Array(output);
|
|
955
|
+
};
|
|
956
|
+
function UTF8Decoder(options) {
|
|
957
|
+
var fatal = options.fatal;
|
|
958
|
+
var utf8_code_point = 0, utf8_bytes_seen = 0, utf8_bytes_needed = 0, utf8_lower_boundary = 128, utf8_upper_boundary = 191;
|
|
959
|
+
this.handler = function(stream2, bite) {
|
|
960
|
+
if (bite === end_of_stream && utf8_bytes_needed !== 0) {
|
|
961
|
+
utf8_bytes_needed = 0;
|
|
962
|
+
return decoderError(fatal);
|
|
963
|
+
}
|
|
964
|
+
if (bite === end_of_stream) return finished;
|
|
965
|
+
if (utf8_bytes_needed === 0) {
|
|
966
|
+
if (inRange(bite, 0, 127)) {
|
|
967
|
+
return bite;
|
|
968
|
+
} else if (inRange(bite, 194, 223)) {
|
|
969
|
+
utf8_bytes_needed = 1;
|
|
970
|
+
utf8_code_point = bite & 31;
|
|
971
|
+
} else if (inRange(bite, 224, 239)) {
|
|
972
|
+
if (bite === 224) utf8_lower_boundary = 160;
|
|
973
|
+
if (bite === 237) utf8_upper_boundary = 159;
|
|
974
|
+
utf8_bytes_needed = 2;
|
|
975
|
+
utf8_code_point = bite & 15;
|
|
976
|
+
} else if (inRange(bite, 240, 244)) {
|
|
977
|
+
if (bite === 240) utf8_lower_boundary = 144;
|
|
978
|
+
if (bite === 244) utf8_upper_boundary = 143;
|
|
979
|
+
utf8_bytes_needed = 3;
|
|
980
|
+
utf8_code_point = bite & 7;
|
|
981
|
+
} else {
|
|
982
|
+
return decoderError(fatal);
|
|
983
|
+
}
|
|
984
|
+
return null;
|
|
985
|
+
}
|
|
986
|
+
if (!inRange(bite, utf8_lower_boundary, utf8_upper_boundary)) {
|
|
987
|
+
utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;
|
|
988
|
+
utf8_lower_boundary = 128;
|
|
989
|
+
utf8_upper_boundary = 191;
|
|
990
|
+
stream2.prepend(bite);
|
|
991
|
+
return decoderError(fatal);
|
|
992
|
+
}
|
|
993
|
+
utf8_lower_boundary = 128;
|
|
994
|
+
utf8_upper_boundary = 191;
|
|
995
|
+
utf8_code_point = utf8_code_point << 6 | bite & 63;
|
|
996
|
+
utf8_bytes_seen += 1;
|
|
997
|
+
if (utf8_bytes_seen !== utf8_bytes_needed) return null;
|
|
998
|
+
var code_point = utf8_code_point;
|
|
999
|
+
utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0;
|
|
1000
|
+
return code_point;
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
function UTF8Encoder(options) {
|
|
1004
|
+
var _fatal = options.fatal;
|
|
1005
|
+
this.handler = function(stream2, code_point) {
|
|
1006
|
+
if (code_point === end_of_stream) return finished;
|
|
1007
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1008
|
+
var count, offset;
|
|
1009
|
+
if (inRange(code_point, 128, 2047)) {
|
|
1010
|
+
count = 1;
|
|
1011
|
+
offset = 192;
|
|
1012
|
+
} else if (inRange(code_point, 2048, 65535)) {
|
|
1013
|
+
count = 2;
|
|
1014
|
+
offset = 224;
|
|
1015
|
+
} else if (inRange(code_point, 65536, 1114111)) {
|
|
1016
|
+
count = 3;
|
|
1017
|
+
offset = 240;
|
|
1018
|
+
}
|
|
1019
|
+
var bytes = [(code_point >> 6 * count) + offset];
|
|
1020
|
+
while (count > 0) {
|
|
1021
|
+
var temp = code_point >> 6 * (count - 1);
|
|
1022
|
+
bytes.push(128 | temp & 63);
|
|
1023
|
+
count -= 1;
|
|
1024
|
+
}
|
|
1025
|
+
return bytes;
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
encoders["UTF-8"] = function(options) {
|
|
1029
|
+
return new UTF8Encoder(options);
|
|
1030
|
+
};
|
|
1031
|
+
decoders["UTF-8"] = function(options) {
|
|
1032
|
+
return new UTF8Decoder(options);
|
|
1033
|
+
};
|
|
1034
|
+
function SingleByteDecoder(index2, options) {
|
|
1035
|
+
var fatal = options.fatal;
|
|
1036
|
+
this.handler = function(stream2, bite) {
|
|
1037
|
+
if (bite === end_of_stream) return finished;
|
|
1038
|
+
if (isASCIIByte(bite)) return bite;
|
|
1039
|
+
var code_point = index2[bite - 128];
|
|
1040
|
+
if (code_point === null) return decoderError(fatal);
|
|
1041
|
+
return code_point;
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
function SingleByteEncoder(index2, options) {
|
|
1045
|
+
var _fatal = options.fatal;
|
|
1046
|
+
this.handler = function(stream2, code_point) {
|
|
1047
|
+
if (code_point === end_of_stream) return finished;
|
|
1048
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1049
|
+
var pointer = indexPointerFor(code_point, index2);
|
|
1050
|
+
if (pointer === null) encoderError(code_point);
|
|
1051
|
+
return pointer + 128;
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
(function() {
|
|
1055
|
+
if (!("encoding-indexes" in globalThis)) return;
|
|
1056
|
+
encodings.forEach(function(category) {
|
|
1057
|
+
if (category.heading !== "Legacy single-byte encodings") return;
|
|
1058
|
+
category.encodings.forEach(function(encoding) {
|
|
1059
|
+
var name = encoding.name;
|
|
1060
|
+
var idx = index(name.toLowerCase());
|
|
1061
|
+
decoders[name] = function(options) {
|
|
1062
|
+
return new SingleByteDecoder(idx, options);
|
|
1063
|
+
};
|
|
1064
|
+
encoders[name] = function(options) {
|
|
1065
|
+
return new SingleByteEncoder(idx, options);
|
|
1066
|
+
};
|
|
1067
|
+
});
|
|
1068
|
+
});
|
|
1069
|
+
})();
|
|
1070
|
+
decoders["GBK"] = function(options) {
|
|
1071
|
+
return new GB18030Decoder(options);
|
|
1072
|
+
};
|
|
1073
|
+
encoders["GBK"] = function(options) {
|
|
1074
|
+
return new GB18030Encoder(options, true);
|
|
1075
|
+
};
|
|
1076
|
+
function GB18030Decoder(options) {
|
|
1077
|
+
var fatal = options.fatal;
|
|
1078
|
+
var gb18030_first = 0, gb18030_second = 0, gb18030_third = 0;
|
|
1079
|
+
this.handler = function(stream2, bite) {
|
|
1080
|
+
if (bite === end_of_stream && gb18030_first === 0 && gb18030_second === 0 && gb18030_third === 0) {
|
|
1081
|
+
return finished;
|
|
1082
|
+
}
|
|
1083
|
+
if (bite === end_of_stream && (gb18030_first !== 0 || gb18030_second !== 0 || gb18030_third !== 0)) {
|
|
1084
|
+
gb18030_first = 0;
|
|
1085
|
+
gb18030_second = 0;
|
|
1086
|
+
gb18030_third = 0;
|
|
1087
|
+
decoderError(fatal);
|
|
1088
|
+
}
|
|
1089
|
+
var code_point;
|
|
1090
|
+
if (gb18030_third !== 0) {
|
|
1091
|
+
code_point = null;
|
|
1092
|
+
if (inRange(bite, 48, 57)) {
|
|
1093
|
+
code_point = indexGB18030RangesCodePointFor(
|
|
1094
|
+
(((gb18030_first - 129) * 10 + gb18030_second - 48) * 126 + gb18030_third - 129) * 10 + bite - 48
|
|
1095
|
+
);
|
|
1096
|
+
}
|
|
1097
|
+
var buffer = [gb18030_second, gb18030_third, bite];
|
|
1098
|
+
gb18030_first = 0;
|
|
1099
|
+
gb18030_second = 0;
|
|
1100
|
+
gb18030_third = 0;
|
|
1101
|
+
if (code_point === null) {
|
|
1102
|
+
stream2.prepend(buffer);
|
|
1103
|
+
return decoderError(fatal);
|
|
1104
|
+
}
|
|
1105
|
+
return code_point;
|
|
1106
|
+
}
|
|
1107
|
+
if (gb18030_second !== 0) {
|
|
1108
|
+
if (inRange(bite, 129, 254)) {
|
|
1109
|
+
gb18030_third = bite;
|
|
1110
|
+
return null;
|
|
1111
|
+
}
|
|
1112
|
+
stream2.prepend([gb18030_second, bite]);
|
|
1113
|
+
gb18030_first = 0;
|
|
1114
|
+
gb18030_second = 0;
|
|
1115
|
+
return decoderError(fatal);
|
|
1116
|
+
}
|
|
1117
|
+
if (gb18030_first !== 0) {
|
|
1118
|
+
if (inRange(bite, 48, 57)) {
|
|
1119
|
+
gb18030_second = bite;
|
|
1120
|
+
return null;
|
|
1121
|
+
}
|
|
1122
|
+
var lead = gb18030_first;
|
|
1123
|
+
var pointer = null;
|
|
1124
|
+
gb18030_first = 0;
|
|
1125
|
+
var offset = bite < 127 ? 64 : 65;
|
|
1126
|
+
if (inRange(bite, 64, 126) || inRange(bite, 128, 254))
|
|
1127
|
+
pointer = (lead - 129) * 190 + (bite - offset);
|
|
1128
|
+
code_point = pointer === null ? null : indexCodePointFor(pointer, index("gb18030"));
|
|
1129
|
+
if (code_point === null && isASCIIByte(bite)) stream2.prepend(bite);
|
|
1130
|
+
if (code_point === null) return decoderError(fatal);
|
|
1131
|
+
return code_point;
|
|
1132
|
+
}
|
|
1133
|
+
if (isASCIIByte(bite)) return bite;
|
|
1134
|
+
if (bite === 128) return 8364;
|
|
1135
|
+
if (inRange(bite, 129, 254)) {
|
|
1136
|
+
gb18030_first = bite;
|
|
1137
|
+
return null;
|
|
1138
|
+
}
|
|
1139
|
+
return decoderError(fatal);
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
function GB18030Encoder(options, gbk_flag) {
|
|
1143
|
+
var _fatal = options.fatal;
|
|
1144
|
+
this.handler = function(stream2, code_point) {
|
|
1145
|
+
if (code_point === end_of_stream) return finished;
|
|
1146
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1147
|
+
if (code_point === 58853) return encoderError(code_point);
|
|
1148
|
+
if (gbk_flag && code_point === 8364) return 128;
|
|
1149
|
+
var pointer = indexPointerFor(code_point, index("gb18030"));
|
|
1150
|
+
if (pointer !== null) {
|
|
1151
|
+
var lead = floor(pointer / 190) + 129;
|
|
1152
|
+
var trail = pointer % 190;
|
|
1153
|
+
var offset = trail < 63 ? 64 : 65;
|
|
1154
|
+
return [lead, trail + offset];
|
|
1155
|
+
}
|
|
1156
|
+
if (gbk_flag) return encoderError(code_point);
|
|
1157
|
+
pointer = indexGB18030RangesPointerFor(code_point);
|
|
1158
|
+
var byte1 = floor(pointer / 10 / 126 / 10);
|
|
1159
|
+
pointer = pointer - byte1 * 10 * 126 * 10;
|
|
1160
|
+
var byte2 = floor(pointer / 10 / 126);
|
|
1161
|
+
pointer = pointer - byte2 * 10 * 126;
|
|
1162
|
+
var byte3 = floor(pointer / 10);
|
|
1163
|
+
var byte4 = pointer - byte3 * 10;
|
|
1164
|
+
return [byte1 + 129, byte2 + 48, byte3 + 129, byte4 + 48];
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
encoders["gb18030"] = function(options) {
|
|
1168
|
+
return new GB18030Encoder(options);
|
|
1169
|
+
};
|
|
1170
|
+
decoders["gb18030"] = function(options) {
|
|
1171
|
+
return new GB18030Decoder(options);
|
|
1172
|
+
};
|
|
1173
|
+
function Big5Decoder(options) {
|
|
1174
|
+
var fatal = options.fatal;
|
|
1175
|
+
var Big5_lead = 0;
|
|
1176
|
+
this.handler = function(stream2, bite) {
|
|
1177
|
+
if (bite === end_of_stream && Big5_lead !== 0) {
|
|
1178
|
+
Big5_lead = 0;
|
|
1179
|
+
return decoderError(fatal);
|
|
1180
|
+
}
|
|
1181
|
+
if (bite === end_of_stream && Big5_lead === 0) return finished;
|
|
1182
|
+
if (Big5_lead !== 0) {
|
|
1183
|
+
var lead = Big5_lead;
|
|
1184
|
+
var pointer = null;
|
|
1185
|
+
Big5_lead = 0;
|
|
1186
|
+
var offset = bite < 127 ? 64 : 98;
|
|
1187
|
+
if (inRange(bite, 64, 126) || inRange(bite, 161, 254))
|
|
1188
|
+
pointer = (lead - 129) * 157 + (bite - offset);
|
|
1189
|
+
switch (pointer) {
|
|
1190
|
+
case 1133:
|
|
1191
|
+
return [202, 772];
|
|
1192
|
+
case 1135:
|
|
1193
|
+
return [202, 780];
|
|
1194
|
+
case 1164:
|
|
1195
|
+
return [234, 772];
|
|
1196
|
+
case 1166:
|
|
1197
|
+
return [234, 780];
|
|
1198
|
+
}
|
|
1199
|
+
var code_point = pointer === null ? null : indexCodePointFor(pointer, index("big5"));
|
|
1200
|
+
if (code_point === null && isASCIIByte(bite)) stream2.prepend(bite);
|
|
1201
|
+
if (code_point === null) return decoderError(fatal);
|
|
1202
|
+
return code_point;
|
|
1203
|
+
}
|
|
1204
|
+
if (isASCIIByte(bite)) return bite;
|
|
1205
|
+
if (inRange(bite, 129, 254)) {
|
|
1206
|
+
Big5_lead = bite;
|
|
1207
|
+
return null;
|
|
1208
|
+
}
|
|
1209
|
+
return decoderError(fatal);
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
function Big5Encoder(options) {
|
|
1213
|
+
var _fatal = options.fatal;
|
|
1214
|
+
this.handler = function(stream2, code_point) {
|
|
1215
|
+
if (code_point === end_of_stream) return finished;
|
|
1216
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1217
|
+
var pointer = indexBig5PointerFor(code_point);
|
|
1218
|
+
if (pointer === null) return encoderError(code_point);
|
|
1219
|
+
var lead = floor(pointer / 157) + 129;
|
|
1220
|
+
if (lead < 161) return encoderError(code_point);
|
|
1221
|
+
var trail = pointer % 157;
|
|
1222
|
+
var offset = trail < 63 ? 64 : 98;
|
|
1223
|
+
return [lead, trail + offset];
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
encoders["Big5"] = function(options) {
|
|
1227
|
+
return new Big5Encoder(options);
|
|
1228
|
+
};
|
|
1229
|
+
decoders["Big5"] = function(options) {
|
|
1230
|
+
return new Big5Decoder(options);
|
|
1231
|
+
};
|
|
1232
|
+
function EUCJPDecoder(options) {
|
|
1233
|
+
var fatal = options.fatal;
|
|
1234
|
+
var eucjp_jis0212_flag = false, eucjp_lead = 0;
|
|
1235
|
+
this.handler = function(stream2, bite) {
|
|
1236
|
+
if (bite === end_of_stream && eucjp_lead !== 0) {
|
|
1237
|
+
eucjp_lead = 0;
|
|
1238
|
+
return decoderError(fatal);
|
|
1239
|
+
}
|
|
1240
|
+
if (bite === end_of_stream && eucjp_lead === 0) return finished;
|
|
1241
|
+
if (eucjp_lead === 142 && inRange(bite, 161, 223)) {
|
|
1242
|
+
eucjp_lead = 0;
|
|
1243
|
+
return 65377 - 161 + bite;
|
|
1244
|
+
}
|
|
1245
|
+
if (eucjp_lead === 143 && inRange(bite, 161, 254)) {
|
|
1246
|
+
eucjp_jis0212_flag = true;
|
|
1247
|
+
eucjp_lead = bite;
|
|
1248
|
+
return null;
|
|
1249
|
+
}
|
|
1250
|
+
if (eucjp_lead !== 0) {
|
|
1251
|
+
var lead = eucjp_lead;
|
|
1252
|
+
eucjp_lead = 0;
|
|
1253
|
+
var code_point = null;
|
|
1254
|
+
if (inRange(lead, 161, 254) && inRange(bite, 161, 254)) {
|
|
1255
|
+
code_point = indexCodePointFor(
|
|
1256
|
+
(lead - 161) * 94 + (bite - 161),
|
|
1257
|
+
index(!eucjp_jis0212_flag ? "jis0208" : "jis0212")
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
eucjp_jis0212_flag = false;
|
|
1261
|
+
if (!inRange(bite, 161, 254)) stream2.prepend(bite);
|
|
1262
|
+
if (code_point === null) return decoderError(fatal);
|
|
1263
|
+
return code_point;
|
|
1264
|
+
}
|
|
1265
|
+
if (isASCIIByte(bite)) return bite;
|
|
1266
|
+
if (bite === 142 || bite === 143 || inRange(bite, 161, 254)) {
|
|
1267
|
+
eucjp_lead = bite;
|
|
1268
|
+
return null;
|
|
1269
|
+
}
|
|
1270
|
+
return decoderError(fatal);
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
function EUCJPEncoder(options) {
|
|
1274
|
+
var _fatal = options.fatal;
|
|
1275
|
+
this.handler = function(stream2, code_point) {
|
|
1276
|
+
if (code_point === end_of_stream) return finished;
|
|
1277
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1278
|
+
if (code_point === 165) return 92;
|
|
1279
|
+
if (code_point === 8254) return 126;
|
|
1280
|
+
if (inRange(code_point, 65377, 65439)) return [142, code_point - 65377 + 161];
|
|
1281
|
+
if (code_point === 8722) code_point = 65293;
|
|
1282
|
+
var pointer = indexPointerFor(code_point, index("jis0208"));
|
|
1283
|
+
if (pointer === null) return encoderError(code_point);
|
|
1284
|
+
var lead = floor(pointer / 94) + 161;
|
|
1285
|
+
var trail = pointer % 94 + 161;
|
|
1286
|
+
return [lead, trail];
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
encoders["EUC-JP"] = function(options) {
|
|
1290
|
+
return new EUCJPEncoder(options);
|
|
1291
|
+
};
|
|
1292
|
+
decoders["EUC-JP"] = function(options) {
|
|
1293
|
+
return new EUCJPDecoder(options);
|
|
1294
|
+
};
|
|
1295
|
+
function ISO2022JPDecoder(options) {
|
|
1296
|
+
var fatal = options.fatal;
|
|
1297
|
+
var states = {
|
|
1298
|
+
ASCII: 0,
|
|
1299
|
+
Roman: 1,
|
|
1300
|
+
Katakana: 2,
|
|
1301
|
+
LeadByte: 3,
|
|
1302
|
+
TrailByte: 4,
|
|
1303
|
+
EscapeStart: 5,
|
|
1304
|
+
Escape: 6
|
|
1305
|
+
};
|
|
1306
|
+
var iso2022jp_decoder_state = states.ASCII, iso2022jp_decoder_output_state = states.ASCII, iso2022jp_lead = 0, iso2022jp_output_flag = false;
|
|
1307
|
+
this.handler = function(stream2, bite) {
|
|
1308
|
+
switch (iso2022jp_decoder_state) {
|
|
1309
|
+
default:
|
|
1310
|
+
case states.ASCII:
|
|
1311
|
+
if (bite === 27) {
|
|
1312
|
+
iso2022jp_decoder_state = states.EscapeStart;
|
|
1313
|
+
return null;
|
|
1314
|
+
}
|
|
1315
|
+
if (inRange(bite, 0, 127) && bite !== 14 && bite !== 15 && bite !== 27) {
|
|
1316
|
+
iso2022jp_output_flag = false;
|
|
1317
|
+
return bite;
|
|
1318
|
+
}
|
|
1319
|
+
if (bite === end_of_stream) {
|
|
1320
|
+
return finished;
|
|
1321
|
+
}
|
|
1322
|
+
iso2022jp_output_flag = false;
|
|
1323
|
+
return decoderError(fatal);
|
|
1324
|
+
case states.Roman:
|
|
1325
|
+
if (bite === 27) {
|
|
1326
|
+
iso2022jp_decoder_state = states.EscapeStart;
|
|
1327
|
+
return null;
|
|
1328
|
+
}
|
|
1329
|
+
if (bite === 92) {
|
|
1330
|
+
iso2022jp_output_flag = false;
|
|
1331
|
+
return 165;
|
|
1332
|
+
}
|
|
1333
|
+
if (bite === 126) {
|
|
1334
|
+
iso2022jp_output_flag = false;
|
|
1335
|
+
return 8254;
|
|
1336
|
+
}
|
|
1337
|
+
if (inRange(bite, 0, 127) && bite !== 14 && bite !== 15 && bite !== 27 && bite !== 92 && bite !== 126) {
|
|
1338
|
+
iso2022jp_output_flag = false;
|
|
1339
|
+
return bite;
|
|
1340
|
+
}
|
|
1341
|
+
if (bite === end_of_stream) {
|
|
1342
|
+
return finished;
|
|
1343
|
+
}
|
|
1344
|
+
iso2022jp_output_flag = false;
|
|
1345
|
+
return decoderError(fatal);
|
|
1346
|
+
case states.Katakana:
|
|
1347
|
+
if (bite === 27) {
|
|
1348
|
+
iso2022jp_decoder_state = states.EscapeStart;
|
|
1349
|
+
return null;
|
|
1350
|
+
}
|
|
1351
|
+
if (inRange(bite, 33, 95)) {
|
|
1352
|
+
iso2022jp_output_flag = false;
|
|
1353
|
+
return 65377 - 33 + bite;
|
|
1354
|
+
}
|
|
1355
|
+
if (bite === end_of_stream) {
|
|
1356
|
+
return finished;
|
|
1357
|
+
}
|
|
1358
|
+
iso2022jp_output_flag = false;
|
|
1359
|
+
return decoderError(fatal);
|
|
1360
|
+
case states.LeadByte:
|
|
1361
|
+
if (bite === 27) {
|
|
1362
|
+
iso2022jp_decoder_state = states.EscapeStart;
|
|
1363
|
+
return null;
|
|
1364
|
+
}
|
|
1365
|
+
if (inRange(bite, 33, 126)) {
|
|
1366
|
+
iso2022jp_output_flag = false;
|
|
1367
|
+
iso2022jp_lead = bite;
|
|
1368
|
+
iso2022jp_decoder_state = states.TrailByte;
|
|
1369
|
+
return null;
|
|
1370
|
+
}
|
|
1371
|
+
if (bite === end_of_stream) {
|
|
1372
|
+
return finished;
|
|
1373
|
+
}
|
|
1374
|
+
iso2022jp_output_flag = false;
|
|
1375
|
+
return decoderError(fatal);
|
|
1376
|
+
case states.TrailByte:
|
|
1377
|
+
if (bite === 27) {
|
|
1378
|
+
iso2022jp_decoder_state = states.EscapeStart;
|
|
1379
|
+
return decoderError(fatal);
|
|
1380
|
+
}
|
|
1381
|
+
if (inRange(bite, 33, 126)) {
|
|
1382
|
+
iso2022jp_decoder_state = states.LeadByte;
|
|
1383
|
+
var pointer = (iso2022jp_lead - 33) * 94 + bite - 33;
|
|
1384
|
+
var code_point = indexCodePointFor(pointer, index("jis0208"));
|
|
1385
|
+
if (code_point === null) return decoderError(fatal);
|
|
1386
|
+
return code_point;
|
|
1387
|
+
}
|
|
1388
|
+
if (bite === end_of_stream) {
|
|
1389
|
+
iso2022jp_decoder_state = states.LeadByte;
|
|
1390
|
+
stream2.prepend(bite);
|
|
1391
|
+
return decoderError(fatal);
|
|
1392
|
+
}
|
|
1393
|
+
iso2022jp_decoder_state = states.LeadByte;
|
|
1394
|
+
return decoderError(fatal);
|
|
1395
|
+
case states.EscapeStart:
|
|
1396
|
+
if (bite === 36 || bite === 40) {
|
|
1397
|
+
iso2022jp_lead = bite;
|
|
1398
|
+
iso2022jp_decoder_state = states.Escape;
|
|
1399
|
+
return null;
|
|
1400
|
+
}
|
|
1401
|
+
stream2.prepend(bite);
|
|
1402
|
+
iso2022jp_output_flag = false;
|
|
1403
|
+
iso2022jp_decoder_state = iso2022jp_decoder_output_state;
|
|
1404
|
+
return decoderError(fatal);
|
|
1405
|
+
case states.Escape:
|
|
1406
|
+
var lead = iso2022jp_lead;
|
|
1407
|
+
iso2022jp_lead = 0;
|
|
1408
|
+
var state = null;
|
|
1409
|
+
if (lead === 40 && bite === 66) state = states.ASCII;
|
|
1410
|
+
if (lead === 40 && bite === 74) state = states.Roman;
|
|
1411
|
+
if (lead === 40 && bite === 73) state = states.Katakana;
|
|
1412
|
+
if (lead === 36 && (bite === 64 || bite === 66)) state = states.LeadByte;
|
|
1413
|
+
if (state !== null) {
|
|
1414
|
+
iso2022jp_decoder_state = iso2022jp_decoder_state = state;
|
|
1415
|
+
var output_flag = iso2022jp_output_flag;
|
|
1416
|
+
iso2022jp_output_flag = true;
|
|
1417
|
+
return !output_flag ? null : decoderError(fatal);
|
|
1418
|
+
}
|
|
1419
|
+
stream2.prepend([lead, bite]);
|
|
1420
|
+
iso2022jp_output_flag = false;
|
|
1421
|
+
iso2022jp_decoder_state = iso2022jp_decoder_output_state;
|
|
1422
|
+
return decoderError(fatal);
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
function ISO2022JPEncoder(options) {
|
|
1427
|
+
var _fatal = options.fatal;
|
|
1428
|
+
var states = {
|
|
1429
|
+
ASCII: 0,
|
|
1430
|
+
Roman: 1,
|
|
1431
|
+
jis0208: 2
|
|
1432
|
+
};
|
|
1433
|
+
var iso2022jp_state = states.ASCII;
|
|
1434
|
+
this.handler = function(stream2, code_point) {
|
|
1435
|
+
if (code_point === end_of_stream && iso2022jp_state !== states.ASCII) {
|
|
1436
|
+
stream2.prepend(code_point);
|
|
1437
|
+
iso2022jp_state = states.ASCII;
|
|
1438
|
+
return [27, 40, 66];
|
|
1439
|
+
}
|
|
1440
|
+
if (code_point === end_of_stream && iso2022jp_state === states.ASCII) return finished;
|
|
1441
|
+
if ((iso2022jp_state === states.ASCII || iso2022jp_state === states.Roman) && (code_point === 14 || code_point === 15 || code_point === 27)) {
|
|
1442
|
+
return encoderError(65533);
|
|
1443
|
+
}
|
|
1444
|
+
if (iso2022jp_state === states.ASCII && isASCIICodePoint(code_point)) return code_point;
|
|
1445
|
+
if (iso2022jp_state === states.Roman && (isASCIICodePoint(code_point) && code_point !== 92 && code_point !== 126 || code_point === 165 || code_point === 8254)) {
|
|
1446
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1447
|
+
if (code_point === 165) return 92;
|
|
1448
|
+
if (code_point === 8254) return 126;
|
|
1449
|
+
}
|
|
1450
|
+
if (isASCIICodePoint(code_point) && iso2022jp_state !== states.ASCII) {
|
|
1451
|
+
stream2.prepend(code_point);
|
|
1452
|
+
iso2022jp_state = states.ASCII;
|
|
1453
|
+
return [27, 40, 66];
|
|
1454
|
+
}
|
|
1455
|
+
if ((code_point === 165 || code_point === 8254) && iso2022jp_state !== states.Roman) {
|
|
1456
|
+
stream2.prepend(code_point);
|
|
1457
|
+
iso2022jp_state = states.Roman;
|
|
1458
|
+
return [27, 40, 74];
|
|
1459
|
+
}
|
|
1460
|
+
if (code_point === 8722) code_point = 65293;
|
|
1461
|
+
var pointer = indexPointerFor(code_point, index("jis0208"));
|
|
1462
|
+
if (pointer === null) return encoderError(code_point);
|
|
1463
|
+
if (iso2022jp_state !== states.jis0208) {
|
|
1464
|
+
stream2.prepend(code_point);
|
|
1465
|
+
iso2022jp_state = states.jis0208;
|
|
1466
|
+
return [27, 36, 66];
|
|
1467
|
+
}
|
|
1468
|
+
var lead = floor(pointer / 94) + 33;
|
|
1469
|
+
var trail = pointer % 94 + 33;
|
|
1470
|
+
return [lead, trail];
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
encoders["ISO-2022-JP"] = function(options) {
|
|
1474
|
+
return new ISO2022JPEncoder(options);
|
|
1475
|
+
};
|
|
1476
|
+
decoders["ISO-2022-JP"] = function(options) {
|
|
1477
|
+
return new ISO2022JPDecoder(options);
|
|
1478
|
+
};
|
|
1479
|
+
function ShiftJISDecoder(options) {
|
|
1480
|
+
var fatal = options.fatal;
|
|
1481
|
+
var Shift_JIS_lead = 0;
|
|
1482
|
+
this.handler = function(stream2, bite) {
|
|
1483
|
+
if (bite === end_of_stream && Shift_JIS_lead !== 0) {
|
|
1484
|
+
Shift_JIS_lead = 0;
|
|
1485
|
+
return decoderError(fatal);
|
|
1486
|
+
}
|
|
1487
|
+
if (bite === end_of_stream && Shift_JIS_lead === 0) return finished;
|
|
1488
|
+
if (Shift_JIS_lead !== 0) {
|
|
1489
|
+
var lead = Shift_JIS_lead;
|
|
1490
|
+
var pointer = null;
|
|
1491
|
+
Shift_JIS_lead = 0;
|
|
1492
|
+
var offset = bite < 127 ? 64 : 65;
|
|
1493
|
+
var lead_offset = lead < 160 ? 129 : 193;
|
|
1494
|
+
if (inRange(bite, 64, 126) || inRange(bite, 128, 252))
|
|
1495
|
+
pointer = (lead - lead_offset) * 188 + bite - offset;
|
|
1496
|
+
if (inRange(pointer, 8836, 10715)) return 57344 - 8836 + pointer;
|
|
1497
|
+
var code_point = pointer === null ? null : indexCodePointFor(pointer, index("jis0208"));
|
|
1498
|
+
if (code_point === null && isASCIIByte(bite)) stream2.prepend(bite);
|
|
1499
|
+
if (code_point === null) return decoderError(fatal);
|
|
1500
|
+
return code_point;
|
|
1501
|
+
}
|
|
1502
|
+
if (isASCIIByte(bite) || bite === 128) return bite;
|
|
1503
|
+
if (inRange(bite, 161, 223)) return 65377 - 161 + bite;
|
|
1504
|
+
if (inRange(bite, 129, 159) || inRange(bite, 224, 252)) {
|
|
1505
|
+
Shift_JIS_lead = bite;
|
|
1506
|
+
return null;
|
|
1507
|
+
}
|
|
1508
|
+
return decoderError(fatal);
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
function ShiftJISEncoder(options) {
|
|
1512
|
+
var _fatal = options.fatal;
|
|
1513
|
+
this.handler = function(stream2, code_point) {
|
|
1514
|
+
if (code_point === end_of_stream) return finished;
|
|
1515
|
+
if (isASCIICodePoint(code_point) || code_point === 128) return code_point;
|
|
1516
|
+
if (code_point === 165) return 92;
|
|
1517
|
+
if (code_point === 8254) return 126;
|
|
1518
|
+
if (inRange(code_point, 65377, 65439)) return code_point - 65377 + 161;
|
|
1519
|
+
if (code_point === 8722) code_point = 65293;
|
|
1520
|
+
var pointer = indexShiftJISPointerFor(code_point);
|
|
1521
|
+
if (pointer === null) return encoderError(code_point);
|
|
1522
|
+
var lead = floor(pointer / 188);
|
|
1523
|
+
var lead_offset = lead < 31 ? 129 : 193;
|
|
1524
|
+
var trail = pointer % 188;
|
|
1525
|
+
var offset = trail < 63 ? 64 : 65;
|
|
1526
|
+
return [lead + lead_offset, trail + offset];
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
encoders["Shift_JIS"] = function(options) {
|
|
1530
|
+
return new ShiftJISEncoder(options);
|
|
1531
|
+
};
|
|
1532
|
+
decoders["Shift_JIS"] = function(options) {
|
|
1533
|
+
return new ShiftJISDecoder(options);
|
|
1534
|
+
};
|
|
1535
|
+
function EUCKRDecoder(options) {
|
|
1536
|
+
var fatal = options.fatal;
|
|
1537
|
+
var euckr_lead = 0;
|
|
1538
|
+
this.handler = function(stream2, bite) {
|
|
1539
|
+
if (bite === end_of_stream && euckr_lead !== 0) {
|
|
1540
|
+
euckr_lead = 0;
|
|
1541
|
+
return decoderError(fatal);
|
|
1542
|
+
}
|
|
1543
|
+
if (bite === end_of_stream && euckr_lead === 0) return finished;
|
|
1544
|
+
if (euckr_lead !== 0) {
|
|
1545
|
+
var lead = euckr_lead;
|
|
1546
|
+
var pointer = null;
|
|
1547
|
+
euckr_lead = 0;
|
|
1548
|
+
if (inRange(bite, 65, 254)) pointer = (lead - 129) * 190 + (bite - 65);
|
|
1549
|
+
var code_point = pointer === null ? null : indexCodePointFor(pointer, index("euc-kr"));
|
|
1550
|
+
if (pointer === null && isASCIIByte(bite)) stream2.prepend(bite);
|
|
1551
|
+
if (code_point === null) return decoderError(fatal);
|
|
1552
|
+
return code_point;
|
|
1553
|
+
}
|
|
1554
|
+
if (isASCIIByte(bite)) return bite;
|
|
1555
|
+
if (inRange(bite, 129, 254)) {
|
|
1556
|
+
euckr_lead = bite;
|
|
1557
|
+
return null;
|
|
1558
|
+
}
|
|
1559
|
+
return decoderError(fatal);
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
function EUCKREncoder(options) {
|
|
1563
|
+
var _fatal = options.fatal;
|
|
1564
|
+
this.handler = function(stream2, code_point) {
|
|
1565
|
+
if (code_point === end_of_stream) return finished;
|
|
1566
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1567
|
+
var pointer = indexPointerFor(code_point, index("euc-kr"));
|
|
1568
|
+
if (pointer === null) return encoderError(code_point);
|
|
1569
|
+
var lead = floor(pointer / 190) + 129;
|
|
1570
|
+
var trail = pointer % 190 + 65;
|
|
1571
|
+
return [lead, trail];
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
encoders["EUC-KR"] = function(options) {
|
|
1575
|
+
return new EUCKREncoder(options);
|
|
1576
|
+
};
|
|
1577
|
+
decoders["EUC-KR"] = function(options) {
|
|
1578
|
+
return new EUCKRDecoder(options);
|
|
1579
|
+
};
|
|
1580
|
+
function convertCodeUnitToBytes(code_unit, utf16be) {
|
|
1581
|
+
var byte1 = code_unit >> 8;
|
|
1582
|
+
var byte2 = code_unit & 255;
|
|
1583
|
+
if (utf16be) return [byte1, byte2];
|
|
1584
|
+
return [byte2, byte1];
|
|
1585
|
+
}
|
|
1586
|
+
function UTF16Decoder(utf16_be, options) {
|
|
1587
|
+
var fatal = options.fatal;
|
|
1588
|
+
var utf16_lead_byte = null, utf16_lead_surrogate = null;
|
|
1589
|
+
this.handler = function(stream2, bite) {
|
|
1590
|
+
if (bite === end_of_stream && (utf16_lead_byte !== null || utf16_lead_surrogate !== null)) {
|
|
1591
|
+
return decoderError(fatal);
|
|
1592
|
+
}
|
|
1593
|
+
if (bite === end_of_stream && utf16_lead_byte === null && utf16_lead_surrogate === null) {
|
|
1594
|
+
return finished;
|
|
1595
|
+
}
|
|
1596
|
+
if (utf16_lead_byte === null) {
|
|
1597
|
+
utf16_lead_byte = bite;
|
|
1598
|
+
return null;
|
|
1599
|
+
}
|
|
1600
|
+
var code_unit;
|
|
1601
|
+
if (utf16_be) {
|
|
1602
|
+
code_unit = (utf16_lead_byte << 8) + bite;
|
|
1603
|
+
} else {
|
|
1604
|
+
code_unit = (bite << 8) + utf16_lead_byte;
|
|
1605
|
+
}
|
|
1606
|
+
utf16_lead_byte = null;
|
|
1607
|
+
if (utf16_lead_surrogate !== null) {
|
|
1608
|
+
var lead_surrogate = utf16_lead_surrogate;
|
|
1609
|
+
utf16_lead_surrogate = null;
|
|
1610
|
+
if (inRange(code_unit, 56320, 57343)) {
|
|
1611
|
+
return 65536 + (lead_surrogate - 55296) * 1024 + (code_unit - 56320);
|
|
1612
|
+
}
|
|
1613
|
+
stream2.prepend(convertCodeUnitToBytes(code_unit, utf16_be));
|
|
1614
|
+
return decoderError(fatal);
|
|
1615
|
+
}
|
|
1616
|
+
if (inRange(code_unit, 55296, 56319)) {
|
|
1617
|
+
utf16_lead_surrogate = code_unit;
|
|
1618
|
+
return null;
|
|
1619
|
+
}
|
|
1620
|
+
if (inRange(code_unit, 56320, 57343)) return decoderError(fatal);
|
|
1621
|
+
return code_unit;
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
function UTF16Encoder(utf16_be, options) {
|
|
1625
|
+
var _fatal = options.fatal;
|
|
1626
|
+
this.handler = function(stream2, code_point) {
|
|
1627
|
+
if (code_point === end_of_stream) return finished;
|
|
1628
|
+
if (inRange(code_point, 0, 65535)) return convertCodeUnitToBytes(code_point, utf16_be);
|
|
1629
|
+
var lead = convertCodeUnitToBytes((code_point - 65536 >> 10) + 55296, utf16_be);
|
|
1630
|
+
var trail = convertCodeUnitToBytes((code_point - 65536 & 1023) + 56320, utf16_be);
|
|
1631
|
+
return lead.concat(trail);
|
|
1632
|
+
};
|
|
1633
|
+
}
|
|
1634
|
+
encoders["UTF-16BE"] = function(options) {
|
|
1635
|
+
return new UTF16Encoder(true, options);
|
|
1636
|
+
};
|
|
1637
|
+
decoders["UTF-16BE"] = function(options) {
|
|
1638
|
+
return new UTF16Decoder(true, options);
|
|
1639
|
+
};
|
|
1640
|
+
encoders["UTF-16LE"] = function(options) {
|
|
1641
|
+
return new UTF16Encoder(false, options);
|
|
1642
|
+
};
|
|
1643
|
+
decoders["UTF-16LE"] = function(options) {
|
|
1644
|
+
return new UTF16Decoder(false, options);
|
|
1645
|
+
};
|
|
1646
|
+
function XUserDefinedDecoder(options) {
|
|
1647
|
+
var _fatal = options.fatal;
|
|
1648
|
+
this.handler = function(stream2, bite) {
|
|
1649
|
+
if (bite === end_of_stream) return finished;
|
|
1650
|
+
if (isASCIIByte(bite)) return bite;
|
|
1651
|
+
return 63360 + bite - 128;
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
function XUserDefinedEncoder(options) {
|
|
1655
|
+
var _fatal = options.fatal;
|
|
1656
|
+
this.handler = function(stream2, code_point) {
|
|
1657
|
+
if (code_point === end_of_stream) return finished;
|
|
1658
|
+
if (isASCIICodePoint(code_point)) return code_point;
|
|
1659
|
+
if (inRange(code_point, 63360, 63487)) return code_point - 63360 + 128;
|
|
1660
|
+
return encoderError(code_point);
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
encoders["x-user-defined"] = function(options) {
|
|
1664
|
+
return new XUserDefinedEncoder(options);
|
|
1665
|
+
};
|
|
1666
|
+
decoders["x-user-defined"] = function(options) {
|
|
1667
|
+
return new XUserDefinedDecoder(options);
|
|
1668
|
+
};
|
|
1669
|
+
|
|
1670
|
+
// src/polyfills/buffer/btoa.node.ts
|
|
1671
|
+
function atob(string) {
|
|
1672
|
+
return Buffer.from(string).toString("base64");
|
|
1673
|
+
}
|
|
1674
|
+
function btoa(base64) {
|
|
1675
|
+
return Buffer.from(base64, "base64").toString("ascii");
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
// src/polyfills/images/image-codecs-node.ts
|
|
1679
|
+
init_node_image_formats();
|
|
1680
|
+
async function parseImageNode2(...parameters) {
|
|
1681
|
+
let decoder;
|
|
1682
|
+
try {
|
|
1683
|
+
decoder = await Promise.resolve().then(() => (init_parse_image_node(), parse_image_node_exports));
|
|
1684
|
+
} catch (error) {
|
|
1685
|
+
throw new Error(
|
|
1686
|
+
"Node image decoding requires get-pixels. Install get-pixels to decode images.",
|
|
1687
|
+
{ cause: error }
|
|
1688
|
+
);
|
|
1689
|
+
}
|
|
1690
|
+
return decoder.parseImageNode(...parameters);
|
|
1691
|
+
}
|
|
1692
|
+
async function encodeImageNode2(...parameters) {
|
|
1693
|
+
let encoder;
|
|
1694
|
+
try {
|
|
1695
|
+
encoder = await Promise.resolve().then(() => (init_encode_image_node(), encode_image_node_exports));
|
|
1696
|
+
} catch (error) {
|
|
1697
|
+
throw new Error(
|
|
1698
|
+
"Node image encoding requires save-pixels and ndarray. Install save-pixels and ndarray to encode images.",
|
|
1699
|
+
{ cause: error }
|
|
1700
|
+
);
|
|
1701
|
+
}
|
|
1702
|
+
return encoder.encodeImageNode(...parameters);
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
// src/polyfills/images/node-image-bitmap.ts
|
|
1706
|
+
var NodeImageBitmap = class {
|
|
1707
|
+
/** Width of the decoded bitmap in pixels. */
|
|
1708
|
+
width;
|
|
1709
|
+
/** Height of the decoded bitmap in pixels. */
|
|
1710
|
+
height;
|
|
1711
|
+
/** Backing pixel data retained until `close()` is called. */
|
|
1712
|
+
data;
|
|
1713
|
+
/** Creates a bitmap wrapper around decoded Node.js image data. */
|
|
1714
|
+
constructor(imageData) {
|
|
1715
|
+
if (!imageData || !imageData.data || !imageData.width || !imageData.height) {
|
|
1716
|
+
throw new Error("NodeImageBitmap requires decoded image data");
|
|
1717
|
+
}
|
|
1718
|
+
this.width = imageData.width;
|
|
1719
|
+
this.height = imageData.height;
|
|
1720
|
+
this.data = imageData.data;
|
|
1721
|
+
}
|
|
1722
|
+
/** Releases the backing pixel data and invalidates further reads. */
|
|
1723
|
+
close() {
|
|
1724
|
+
this.width = 0;
|
|
1725
|
+
this.height = 0;
|
|
1726
|
+
this.data = null;
|
|
1727
|
+
}
|
|
1728
|
+
/** Returns the decoded image data backing this bitmap. */
|
|
1729
|
+
_getImageData() {
|
|
1730
|
+
if (!this.data) {
|
|
1731
|
+
throw new Error("ImageBitmap is closed");
|
|
1732
|
+
}
|
|
1733
|
+
return {
|
|
1734
|
+
data: this.data,
|
|
1735
|
+
width: this.width,
|
|
1736
|
+
height: this.height
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
};
|
|
1740
|
+
function isNodeImageBitmap(image) {
|
|
1741
|
+
return image instanceof NodeImageBitmap;
|
|
1742
|
+
}
|
|
1743
|
+
function createImageBitmapNode(imageData) {
|
|
1744
|
+
return new NodeImageBitmap(imageData);
|
|
1745
|
+
}
|
|
1746
|
+
function getImageBitmapDataNode(image) {
|
|
1747
|
+
if (!isNodeImageBitmap(image)) {
|
|
1748
|
+
throw new Error("getImageBitmapData");
|
|
1749
|
+
}
|
|
1750
|
+
return image._getImageData();
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
// src/polyfills/utils/path-utils.ts
|
|
1754
|
+
var pathPrefix = "";
|
|
1755
|
+
var fileAliases = /* @__PURE__ */ new Map();
|
|
1756
|
+
function setPathPrefix(prefix) {
|
|
1757
|
+
pathPrefix = prefix;
|
|
1758
|
+
}
|
|
1759
|
+
function addAliases(aliases) {
|
|
1760
|
+
for (const [alias, replacement] of Object.entries(aliases)) {
|
|
1761
|
+
fileAliases.set(alias, replacement);
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
function resolvePath(filename) {
|
|
1765
|
+
for (const [alias, replacement] of fileAliases) {
|
|
1766
|
+
if (filename.startsWith(alias)) {
|
|
1767
|
+
filename = filename.replace(alias, replacement);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
if (!filename.startsWith("http://") && !filename.startsWith("https://")) {
|
|
1771
|
+
filename = `${pathPrefix}${filename}`;
|
|
1772
|
+
}
|
|
1773
|
+
return filename;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
// src/polyfills/filesystems/node-file.ts
|
|
1777
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
1778
|
+
var NodeFile = class {
|
|
1779
|
+
handle;
|
|
1780
|
+
size;
|
|
1781
|
+
bigsize;
|
|
1782
|
+
url;
|
|
1783
|
+
constructor(path2, flags, mode) {
|
|
1784
|
+
path2 = resolvePath(path2);
|
|
1785
|
+
this.handle = import_fs.default.openSync(path2, flags, mode);
|
|
1786
|
+
const stats = import_fs.default.fstatSync(this.handle, { bigint: true });
|
|
1787
|
+
this.size = Number(stats.size);
|
|
1788
|
+
this.bigsize = stats.size;
|
|
1789
|
+
this.url = path2;
|
|
1790
|
+
}
|
|
1791
|
+
async close() {
|
|
1792
|
+
return new Promise((resolve, reject) => {
|
|
1793
|
+
import_fs.default.close(this.handle, (err) => err ? reject(err) : resolve());
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
async truncate(length) {
|
|
1797
|
+
return new Promise((resolve, reject) => {
|
|
1798
|
+
import_fs.default.ftruncate(this.handle, length, (err) => {
|
|
1799
|
+
if (err) {
|
|
1800
|
+
reject(err);
|
|
1801
|
+
} else {
|
|
1802
|
+
this.bigsize = BigInt(length);
|
|
1803
|
+
this.size = Number(this.bigsize);
|
|
1804
|
+
resolve();
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
async append(data) {
|
|
1810
|
+
return new Promise((resolve, reject) => {
|
|
1811
|
+
import_fs.default.appendFile(this.handle, data, (err) => {
|
|
1812
|
+
if (err) {
|
|
1813
|
+
reject(err);
|
|
1814
|
+
} else {
|
|
1815
|
+
this.bigsize = this.bigsize + BigInt(data.length);
|
|
1816
|
+
this.size = Number(this.bigsize);
|
|
1817
|
+
resolve();
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
async stat() {
|
|
1823
|
+
return await new Promise(
|
|
1824
|
+
(resolve, reject) => import_fs.default.fstat(this.handle, { bigint: true }, (err, info) => {
|
|
1825
|
+
const stats = {
|
|
1826
|
+
size: Number(info.size),
|
|
1827
|
+
bigsize: info.size,
|
|
1828
|
+
isDirectory: info.isDirectory()
|
|
1829
|
+
};
|
|
1830
|
+
if (err) {
|
|
1831
|
+
reject(err);
|
|
1832
|
+
} else {
|
|
1833
|
+
resolve(stats);
|
|
1834
|
+
}
|
|
1835
|
+
})
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
async read(offset, length) {
|
|
1839
|
+
const arrayBuffer = new ArrayBuffer(length);
|
|
1840
|
+
let bigOffset = BigInt(offset);
|
|
1841
|
+
let totalBytesRead = 0;
|
|
1842
|
+
const uint8Array = new Uint8Array(arrayBuffer);
|
|
1843
|
+
let position;
|
|
1844
|
+
while (length > 0) {
|
|
1845
|
+
const bytesRead = await readBytes(this.handle, uint8Array, 0, length, bigOffset);
|
|
1846
|
+
if (bytesRead === 0) {
|
|
1847
|
+
break;
|
|
1848
|
+
}
|
|
1849
|
+
totalBytesRead += bytesRead;
|
|
1850
|
+
bigOffset += BigInt(bytesRead);
|
|
1851
|
+
length -= bytesRead;
|
|
1852
|
+
if (position !== void 0) {
|
|
1853
|
+
position += bytesRead;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
return totalBytesRead < length ? arrayBuffer.slice(0, totalBytesRead) : arrayBuffer;
|
|
1857
|
+
}
|
|
1858
|
+
async write(arrayBuffer, offset = 0, length = arrayBuffer.byteLength) {
|
|
1859
|
+
return new Promise((resolve, reject) => {
|
|
1860
|
+
const nOffset = Number(offset);
|
|
1861
|
+
const uint8Array = new Uint8Array(arrayBuffer, Number(offset), length);
|
|
1862
|
+
import_fs.default.write(
|
|
1863
|
+
this.handle,
|
|
1864
|
+
uint8Array,
|
|
1865
|
+
0,
|
|
1866
|
+
length,
|
|
1867
|
+
nOffset,
|
|
1868
|
+
(err, bytesWritten) => err ? reject(err) : resolve(bytesWritten)
|
|
1869
|
+
);
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
async function readBytes(fd, uint8Array, offset, length, position) {
|
|
1874
|
+
return await new Promise(
|
|
1875
|
+
(resolve, reject) => import_fs.default.read(
|
|
1876
|
+
fd,
|
|
1877
|
+
uint8Array,
|
|
1878
|
+
offset,
|
|
1879
|
+
length,
|
|
1880
|
+
position,
|
|
1881
|
+
(err, bytesRead) => err ? reject(err) : resolve(bytesRead)
|
|
1882
|
+
)
|
|
1883
|
+
);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
// src/polyfills/filesystems/node-filesystem.ts
|
|
1887
|
+
var import_promises = __toESM(require("fs/promises"), 1);
|
|
1888
|
+
|
|
1889
|
+
// src/polyfills/filesystems/fetch-node.ts
|
|
1890
|
+
var import_fs2 = __toESM(require("fs"), 1);
|
|
1891
|
+
var import_stream = require("stream");
|
|
1892
|
+
|
|
1893
|
+
// src/polyfills/filesystems/stream-utils.node.ts
|
|
1894
|
+
var import_zlib = __toESM(require("zlib"), 1);
|
|
1895
|
+
|
|
1896
|
+
// src/polyfills/utils/buffer-utils.ts
|
|
1897
|
+
function toArrayBuffer(data) {
|
|
1898
|
+
if (data instanceof ArrayBuffer) {
|
|
1899
|
+
return data;
|
|
1900
|
+
}
|
|
1901
|
+
if (ArrayBuffer.isView(data)) {
|
|
1902
|
+
return ensureArrayBuffer(data);
|
|
1903
|
+
}
|
|
1904
|
+
return ensureArrayBuffer(data);
|
|
1905
|
+
}
|
|
1906
|
+
function ensureArrayBuffer(data) {
|
|
1907
|
+
if (data instanceof ArrayBuffer) {
|
|
1908
|
+
return data;
|
|
1909
|
+
}
|
|
1910
|
+
if (ArrayBuffer.isView(data)) {
|
|
1911
|
+
const { buffer, byteOffset, byteLength } = data;
|
|
1912
|
+
if (buffer instanceof ArrayBuffer && byteOffset === 0 && byteLength === buffer.byteLength) {
|
|
1913
|
+
return buffer;
|
|
1914
|
+
}
|
|
1915
|
+
return copyArrayBufferRange(buffer, byteOffset, byteLength);
|
|
1916
|
+
}
|
|
1917
|
+
return copyArrayBufferRange(data);
|
|
1918
|
+
}
|
|
1919
|
+
function copyArrayBufferRange(buffer, offset = 0, length = buffer.byteLength - offset) {
|
|
1920
|
+
const copy = new Uint8Array(length);
|
|
1921
|
+
copy.set(new Uint8Array(buffer, offset, length));
|
|
1922
|
+
return copy.buffer;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
// src/polyfills/filesystems/stream-utils.node.ts
|
|
1926
|
+
function decompressReadStream(readStream, headers) {
|
|
1927
|
+
switch (headers?.get("content-encoding")) {
|
|
1928
|
+
case "br":
|
|
1929
|
+
return readStream.pipe(import_zlib.default.createBrotliDecompress());
|
|
1930
|
+
case "gzip":
|
|
1931
|
+
return readStream.pipe(import_zlib.default.createGunzip());
|
|
1932
|
+
case "deflate":
|
|
1933
|
+
return readStream.pipe(import_zlib.default.createDeflate());
|
|
1934
|
+
default:
|
|
1935
|
+
return readStream;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
async function concatenateReadStream(readStream) {
|
|
1939
|
+
const arrayBufferChunks = [];
|
|
1940
|
+
return await new Promise((resolve, reject) => {
|
|
1941
|
+
readStream.on("error", (error) => reject(error));
|
|
1942
|
+
readStream.on("readable", () => readStream.read());
|
|
1943
|
+
readStream.on("data", (chunk) => {
|
|
1944
|
+
if (typeof chunk === "string") {
|
|
1945
|
+
reject(new Error("Read stream not binary"));
|
|
1946
|
+
}
|
|
1947
|
+
arrayBufferChunks.push(toArrayBuffer(chunk));
|
|
1948
|
+
});
|
|
1949
|
+
readStream.on("end", () => {
|
|
1950
|
+
const arrayBuffer = concatenateArrayBuffers(arrayBufferChunks);
|
|
1951
|
+
resolve(arrayBuffer);
|
|
1952
|
+
});
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
function concatenateArrayBuffers(sources) {
|
|
1956
|
+
const sourceArrays = sources.map(
|
|
1957
|
+
(source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2
|
|
1958
|
+
);
|
|
1959
|
+
const byteLength = sourceArrays.reduce((length, typedArray) => length + typedArray.byteLength, 0);
|
|
1960
|
+
const result = new Uint8Array(byteLength);
|
|
1961
|
+
let offset = 0;
|
|
1962
|
+
for (const sourceArray of sourceArrays) {
|
|
1963
|
+
result.set(sourceArray, offset);
|
|
1964
|
+
offset += sourceArray.byteLength;
|
|
1965
|
+
}
|
|
1966
|
+
return result.buffer;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
// src/polyfills/filesystems/fetch-node.ts
|
|
1970
|
+
var isBoolean = (x) => typeof x === "boolean";
|
|
1971
|
+
var isFunction = (x) => typeof x === "function";
|
|
1972
|
+
var isObject = (x) => x !== null && typeof x === "object";
|
|
1973
|
+
var isReadableNodeStream = (x) => isObject(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);
|
|
1974
|
+
async function fetchNode(url, options) {
|
|
1975
|
+
const FILE_PROTOCOL_REGEX = /^file:\/\//;
|
|
1976
|
+
url.replace(FILE_PROTOCOL_REGEX, "/");
|
|
1977
|
+
let noqueryUrl = url.split("?")[0];
|
|
1978
|
+
noqueryUrl = resolvePath(noqueryUrl);
|
|
1979
|
+
const responseHeaders = new Headers();
|
|
1980
|
+
if (url.endsWith(".gz")) {
|
|
1981
|
+
responseHeaders.set("content-encoding", "gzip");
|
|
1982
|
+
}
|
|
1983
|
+
if (url.endsWith(".br")) {
|
|
1984
|
+
responseHeaders.set("content-encoding", "br");
|
|
1985
|
+
}
|
|
1986
|
+
try {
|
|
1987
|
+
const body = await new Promise((resolve, reject) => {
|
|
1988
|
+
const stream2 = import_fs2.default.createReadStream(noqueryUrl, { encoding: null });
|
|
1989
|
+
stream2.once("readable", () => resolve(stream2));
|
|
1990
|
+
stream2.on("error", (error) => reject(error));
|
|
1991
|
+
});
|
|
1992
|
+
let bodyStream = body;
|
|
1993
|
+
if (isReadableNodeStream(body)) {
|
|
1994
|
+
bodyStream = decompressReadStream(body, responseHeaders);
|
|
1995
|
+
} else if (typeof body === "string") {
|
|
1996
|
+
bodyStream = import_stream.Readable.from([new TextEncoder().encode(body)]);
|
|
1997
|
+
} else {
|
|
1998
|
+
bodyStream = import_stream.Readable.from([body || new ArrayBuffer(0)]);
|
|
1999
|
+
}
|
|
2000
|
+
const status = 200;
|
|
2001
|
+
const statusText = "OK";
|
|
2002
|
+
const headers = getHeadersForFile(noqueryUrl);
|
|
2003
|
+
const response = new Response(bodyStream, { headers, status, statusText });
|
|
2004
|
+
Object.defineProperty(response, "url", { value: url });
|
|
2005
|
+
return response;
|
|
2006
|
+
} catch (error) {
|
|
2007
|
+
const errorMessage = error.message;
|
|
2008
|
+
const status = 400;
|
|
2009
|
+
const statusText = errorMessage;
|
|
2010
|
+
const headers = {};
|
|
2011
|
+
const response = new Response(errorMessage, { headers, status, statusText });
|
|
2012
|
+
Object.defineProperty(response, "url", { value: url });
|
|
2013
|
+
return response;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
function getHeadersForFile(noqueryUrl) {
|
|
2017
|
+
const headers = {};
|
|
2018
|
+
if (!headers["content-length"]) {
|
|
2019
|
+
const stats = import_fs2.default.statSync(noqueryUrl);
|
|
2020
|
+
headers["content-length"] = stats.size;
|
|
2021
|
+
}
|
|
2022
|
+
if (noqueryUrl.endsWith(".gz")) {
|
|
2023
|
+
noqueryUrl = noqueryUrl.slice(0, -3);
|
|
2024
|
+
headers["content-encoding"] = "gzip";
|
|
2025
|
+
}
|
|
2026
|
+
return new Headers(headers);
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
// src/polyfills/filesystems/node-filesystem.ts
|
|
2030
|
+
var NodeFileSystem = class {
|
|
2031
|
+
readable = true;
|
|
2032
|
+
writable = true;
|
|
2033
|
+
// implements FileSystem
|
|
2034
|
+
constructor() {
|
|
2035
|
+
}
|
|
2036
|
+
async readdir(dirname = ".", options) {
|
|
2037
|
+
return await import_promises.default.readdir(dirname, options);
|
|
2038
|
+
}
|
|
2039
|
+
async stat(path2) {
|
|
2040
|
+
const info = await import_promises.default.stat(path2, { bigint: true });
|
|
2041
|
+
return {
|
|
2042
|
+
size: Number(info.size),
|
|
2043
|
+
bigsize: info.size,
|
|
2044
|
+
isDirectory: info.isDirectory()
|
|
2045
|
+
};
|
|
2046
|
+
}
|
|
2047
|
+
async unlink(path2) {
|
|
2048
|
+
return await import_promises.default.unlink(path2);
|
|
2049
|
+
}
|
|
2050
|
+
async fetch(path2, options) {
|
|
2051
|
+
return await fetchNode(path2, options);
|
|
2052
|
+
}
|
|
2053
|
+
// implements IRandomAccessFileSystem
|
|
2054
|
+
async openReadableFile(path2, flags = "r") {
|
|
2055
|
+
return new NodeFile(path2, flags);
|
|
2056
|
+
}
|
|
2057
|
+
async openWritableFile(path2, flags = "w", mode) {
|
|
2058
|
+
return new NodeFile(path2, flags, mode);
|
|
2059
|
+
}
|
|
2060
|
+
};
|
|
2061
|
+
|
|
2062
|
+
// src/polyfills/crypto/node-hash.ts
|
|
2063
|
+
var crypto = __toESM(require("crypto"), 1);
|
|
2064
|
+
var NodeHash = class {
|
|
2065
|
+
name = "crypto-node";
|
|
2066
|
+
options;
|
|
2067
|
+
// @ts-ignore
|
|
2068
|
+
_algorithm;
|
|
2069
|
+
// @ts-ignore
|
|
2070
|
+
_hash;
|
|
2071
|
+
constructor(options) {
|
|
2072
|
+
this.options = options;
|
|
2073
|
+
this.hashBatches = this.hashBatches.bind(this);
|
|
2074
|
+
if (!this.options?.crypto?.algorithm) {
|
|
2075
|
+
throw new Error(this.name);
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
/** Complete the optional hash initialization step. */
|
|
2079
|
+
async preload() {
|
|
2080
|
+
return;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Atomic hash calculation
|
|
2084
|
+
* @returns base64 encoded hash
|
|
2085
|
+
*/
|
|
2086
|
+
async hash(input, encoding) {
|
|
2087
|
+
const algorithm = this.options?.crypto?.algorithm?.toLowerCase();
|
|
2088
|
+
try {
|
|
2089
|
+
if (!crypto.createHash) {
|
|
2090
|
+
throw new Error("crypto.createHash not available");
|
|
2091
|
+
}
|
|
2092
|
+
const hash = crypto.createHash?.(algorithm);
|
|
2093
|
+
const inputArray = new Uint8Array(input);
|
|
2094
|
+
return hash.update(inputArray).digest("base64");
|
|
2095
|
+
} catch (error) {
|
|
2096
|
+
throw Error(`${algorithm} hash not available. ${error}`);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
async *hashBatches(asyncIterator, encoding = "base64") {
|
|
2100
|
+
if (!crypto.createHash) {
|
|
2101
|
+
throw new Error("crypto.createHash not available");
|
|
2102
|
+
}
|
|
2103
|
+
const hash = crypto.createHash?.(this.options?.crypto?.algorithm?.toLowerCase());
|
|
2104
|
+
for await (const chunk of asyncIterator) {
|
|
2105
|
+
const inputArray = new Uint8Array(chunk);
|
|
2106
|
+
hash.update(inputArray);
|
|
2107
|
+
yield chunk;
|
|
2108
|
+
}
|
|
2109
|
+
const digest = hash.digest(encoding);
|
|
2110
|
+
this.options?.crypto?.onEnd?.({ hash: digest });
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
|
|
2114
|
+
// src/polyfills/index.ts
|
|
2115
|
+
var import_node_process = require("node:process");
|
|
2116
|
+
var import_web2 = require("node:stream/web");
|
|
2117
|
+
|
|
2118
|
+
// src/polyfills/streams/make-node-stream.ts
|
|
2119
|
+
var Stream2 = __toESM(require("stream"), 1);
|
|
2120
|
+
var _Readable = class {
|
|
2121
|
+
};
|
|
2122
|
+
var Readable3 = Stream2.Readable || _Readable;
|
|
2123
|
+
function makeNodeStream(source, options) {
|
|
2124
|
+
const iterator = source[Symbol.asyncIterator] ? (
|
|
2125
|
+
// @ts-ignore AsyncGenerator
|
|
2126
|
+
source[Symbol.asyncIterator]()
|
|
2127
|
+
) : (
|
|
2128
|
+
// @ts-ignore AsyncGenerator
|
|
2129
|
+
source[Symbol.iterator]()
|
|
2130
|
+
);
|
|
2131
|
+
return new AsyncIterableReadable(iterator, options);
|
|
2132
|
+
}
|
|
2133
|
+
var AsyncIterableReadable = class extends Readable3 {
|
|
2134
|
+
_pulling;
|
|
2135
|
+
_bytesMode;
|
|
2136
|
+
_iterator;
|
|
2137
|
+
constructor(it, options) {
|
|
2138
|
+
super(options);
|
|
2139
|
+
this._iterator = it;
|
|
2140
|
+
this._pulling = false;
|
|
2141
|
+
this._bytesMode = !options || !options.objectMode;
|
|
2142
|
+
}
|
|
2143
|
+
async _read(size) {
|
|
2144
|
+
if (!this._pulling) {
|
|
2145
|
+
this._pulling = true;
|
|
2146
|
+
this._pulling = await this._pull(size, this._iterator);
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
async _destroy(error, cb) {
|
|
2150
|
+
if (!this._iterator) {
|
|
2151
|
+
return;
|
|
2152
|
+
}
|
|
2153
|
+
if (error) {
|
|
2154
|
+
await this._iterator?.throw?.(error);
|
|
2155
|
+
} else {
|
|
2156
|
+
await this._iterator?.return?.(error);
|
|
2157
|
+
}
|
|
2158
|
+
cb?.(null);
|
|
2159
|
+
}
|
|
2160
|
+
// eslint-disable-next-line complexity
|
|
2161
|
+
async _pull(size, it) {
|
|
2162
|
+
const bm = this._bytesMode;
|
|
2163
|
+
let r = null;
|
|
2164
|
+
while (this.readable) {
|
|
2165
|
+
r = await it.next();
|
|
2166
|
+
if (r.done) {
|
|
2167
|
+
break;
|
|
2168
|
+
}
|
|
2169
|
+
if (size !== null) {
|
|
2170
|
+
size -= bm && ArrayBuffer.isView(r.value) ? r.value.byteLength : 1;
|
|
2171
|
+
}
|
|
2172
|
+
if (!this.push(new Uint8Array(r.value)) || size <= 0) {
|
|
2173
|
+
break;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
if ((r?.done || !this.readable) && (this.push(null) || true)) {
|
|
2177
|
+
it?.return?.();
|
|
2178
|
+
}
|
|
2179
|
+
return !this.readable;
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
|
|
2183
|
+
// src/polyfills/file/readable-stream.ts
|
|
2184
|
+
var import_web = require("node:stream/web");
|
|
2185
|
+
var ReadableStreamPolyfill = class extends import_web.ReadableStream {
|
|
2186
|
+
};
|
|
2187
|
+
|
|
2188
|
+
// src/polyfills/file/blob-stream-controller.ts
|
|
2189
|
+
var BlobStreamController = class {
|
|
2190
|
+
chunks;
|
|
2191
|
+
isWorking = false;
|
|
2192
|
+
isCancelled = false;
|
|
2193
|
+
/**
|
|
2194
|
+
* @param chunks
|
|
2195
|
+
*/
|
|
2196
|
+
constructor(chunks) {
|
|
2197
|
+
this.chunks = chunks;
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* @param controller
|
|
2201
|
+
*/
|
|
2202
|
+
start(controller) {
|
|
2203
|
+
this.work(controller);
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
*
|
|
2207
|
+
* @param controller
|
|
2208
|
+
*/
|
|
2209
|
+
async work(controller) {
|
|
2210
|
+
const { chunks } = this;
|
|
2211
|
+
this.isWorking = true;
|
|
2212
|
+
while (!this.isCancelled && (controller.desiredSize || 0) > 0) {
|
|
2213
|
+
let next;
|
|
2214
|
+
try {
|
|
2215
|
+
next = chunks.next();
|
|
2216
|
+
} catch (error) {
|
|
2217
|
+
controller.error(error);
|
|
2218
|
+
break;
|
|
2219
|
+
}
|
|
2220
|
+
if (next) {
|
|
2221
|
+
if (!next.done && !this.isCancelled) {
|
|
2222
|
+
controller.enqueue(next.value);
|
|
2223
|
+
} else {
|
|
2224
|
+
controller.close();
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
this.isWorking = false;
|
|
2229
|
+
}
|
|
2230
|
+
/**
|
|
2231
|
+
*
|
|
2232
|
+
* @param {ReadableStreamDefaultController} controller
|
|
2233
|
+
*/
|
|
2234
|
+
pull(controller) {
|
|
2235
|
+
if (!this.isWorking) {
|
|
2236
|
+
this.work(controller);
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
cancel() {
|
|
2240
|
+
this.isCancelled = true;
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
|
|
2244
|
+
// src/polyfills/file/blob-stream.ts
|
|
2245
|
+
var BlobStream = class extends ReadableStreamPolyfill {
|
|
2246
|
+
_chunks;
|
|
2247
|
+
/**
|
|
2248
|
+
* @param chunks
|
|
2249
|
+
*/
|
|
2250
|
+
constructor(chunks) {
|
|
2251
|
+
super(new BlobStreamController(chunks.values()), { type: "bytes" });
|
|
2252
|
+
this._chunks = chunks;
|
|
2253
|
+
}
|
|
2254
|
+
/**
|
|
2255
|
+
* @property [_options.preventCancel]
|
|
2256
|
+
*/
|
|
2257
|
+
// @ts-ignore
|
|
2258
|
+
async *[Symbol.asyncIterator](_options) {
|
|
2259
|
+
const reader = this.getReader();
|
|
2260
|
+
yield* this._chunks;
|
|
2261
|
+
reader.releaseLock();
|
|
2262
|
+
}
|
|
2263
|
+
};
|
|
2264
|
+
|
|
2265
|
+
// src/polyfills/file/blob.ts
|
|
2266
|
+
var BlobPolyfill = class _BlobPolyfill {
|
|
2267
|
+
// implements Blob {
|
|
2268
|
+
/** The MIME type of the data contained in the Blob. If type is unknown, string is empty. */
|
|
2269
|
+
type;
|
|
2270
|
+
/** The size, in bytes, of the data contained in the Blob object. */
|
|
2271
|
+
size;
|
|
2272
|
+
parts;
|
|
2273
|
+
/**
|
|
2274
|
+
* @param [init]
|
|
2275
|
+
* @param [options]
|
|
2276
|
+
*/
|
|
2277
|
+
constructor(init = [], options = {}) {
|
|
2278
|
+
this.parts = [];
|
|
2279
|
+
this.size = 0;
|
|
2280
|
+
for (const part of init) {
|
|
2281
|
+
if (typeof part === "string") {
|
|
2282
|
+
const bytes = new TextEncoder().encode(part);
|
|
2283
|
+
this.parts.push(bytes);
|
|
2284
|
+
this.size += bytes.byteLength;
|
|
2285
|
+
} else if (part instanceof _BlobPolyfill) {
|
|
2286
|
+
this.size += part.size;
|
|
2287
|
+
this.parts.push(...part.parts);
|
|
2288
|
+
} else if (part instanceof ArrayBuffer) {
|
|
2289
|
+
this.parts.push(new Uint8Array(part));
|
|
2290
|
+
this.size += part.byteLength;
|
|
2291
|
+
} else if (part instanceof Uint8Array) {
|
|
2292
|
+
this.parts.push(part);
|
|
2293
|
+
this.size += part.byteLength;
|
|
2294
|
+
} else if (ArrayBuffer.isView(part)) {
|
|
2295
|
+
const { buffer, byteOffset, byteLength } = part;
|
|
2296
|
+
this.parts.push(new Uint8Array(buffer, byteOffset, byteLength));
|
|
2297
|
+
this.size += byteLength;
|
|
2298
|
+
} else {
|
|
2299
|
+
const bytes = new TextEncoder().encode(String(part));
|
|
2300
|
+
this.parts.push(bytes);
|
|
2301
|
+
this.size += bytes.byteLength;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
this.type = readType(options.type);
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Returns a new Blob object containing the data in the specified range of
|
|
2308
|
+
* bytes of the blob on which it's called.
|
|
2309
|
+
* @param start=0 - An index into the Blob indicating the first
|
|
2310
|
+
* byte to include in the new Blob. If you specify a negative value, it's
|
|
2311
|
+
* treated as an offset from the end of the Blob toward the beginning. For
|
|
2312
|
+
* example, `-10` would be the 10th from last byte in the Blob. The default
|
|
2313
|
+
* value is `0`. If you specify a value for start that is larger than the
|
|
2314
|
+
* size of the source Blob, the returned Blob has size 0 and contains no
|
|
2315
|
+
* data.
|
|
2316
|
+
* @param end - An index into the `Blob` indicating the first byte
|
|
2317
|
+
* that will *not* be included in the new `Blob` (i.e. the byte exactly at
|
|
2318
|
+
* this index is not included). If you specify a negative value, it's treated
|
|
2319
|
+
* as an offset from the end of the Blob toward the beginning. For example,
|
|
2320
|
+
* `-10` would be the 10th from last byte in the `Blob`. The default value is
|
|
2321
|
+
* size.
|
|
2322
|
+
* @param type - The content type to assign to the new Blob;
|
|
2323
|
+
* this will be the value of its type property. The default value is an empty
|
|
2324
|
+
* string.
|
|
2325
|
+
*/
|
|
2326
|
+
slice(start = 0, end = this.size, type = "") {
|
|
2327
|
+
const { size, parts } = this;
|
|
2328
|
+
let offset = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);
|
|
2329
|
+
let limit = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);
|
|
2330
|
+
const span = Math.max(limit - offset, 0);
|
|
2331
|
+
const blob = new _BlobPolyfill([], { type });
|
|
2332
|
+
if (span === 0) {
|
|
2333
|
+
return blob;
|
|
2334
|
+
}
|
|
2335
|
+
let blobSize = 0;
|
|
2336
|
+
const blobParts = [];
|
|
2337
|
+
for (const part of parts) {
|
|
2338
|
+
const { byteLength } = part;
|
|
2339
|
+
if (offset > 0 && byteLength <= offset) {
|
|
2340
|
+
offset -= byteLength;
|
|
2341
|
+
limit -= byteLength;
|
|
2342
|
+
} else {
|
|
2343
|
+
const chunk = part.subarray(offset, Math.min(byteLength, limit));
|
|
2344
|
+
blobParts.push(chunk);
|
|
2345
|
+
blobSize += chunk.byteLength;
|
|
2346
|
+
offset = 0;
|
|
2347
|
+
if (blobSize >= span) {
|
|
2348
|
+
break;
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
blob.parts = blobParts;
|
|
2353
|
+
blob.size = blobSize;
|
|
2354
|
+
return blob;
|
|
2355
|
+
}
|
|
2356
|
+
/**
|
|
2357
|
+
* Returns a promise that resolves with an ArrayBuffer containing the entire
|
|
2358
|
+
* contents of the Blob as binary data.
|
|
2359
|
+
*/
|
|
2360
|
+
// eslint-disable-next-line require-await
|
|
2361
|
+
async arrayBuffer() {
|
|
2362
|
+
return this._toArrayBuffer();
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Returns a promise that resolves with a USVString containing the entire
|
|
2366
|
+
* contents of the Blob interpreted as UTF-8 text.
|
|
2367
|
+
*/
|
|
2368
|
+
// eslint-disable-next-line require-await
|
|
2369
|
+
async text() {
|
|
2370
|
+
const decoder = new TextDecoder();
|
|
2371
|
+
let text = "";
|
|
2372
|
+
for (const part of this.parts) {
|
|
2373
|
+
text += decoder.decode(part);
|
|
2374
|
+
}
|
|
2375
|
+
return text;
|
|
2376
|
+
}
|
|
2377
|
+
/**
|
|
2378
|
+
*/
|
|
2379
|
+
// @ts-ignore
|
|
2380
|
+
stream() {
|
|
2381
|
+
return new BlobStream(this.parts);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* @returns {string}
|
|
2385
|
+
*/
|
|
2386
|
+
toString() {
|
|
2387
|
+
return "[object Blob]";
|
|
2388
|
+
}
|
|
2389
|
+
get [Symbol.toStringTag]() {
|
|
2390
|
+
return "Blob";
|
|
2391
|
+
}
|
|
2392
|
+
_toArrayBuffer() {
|
|
2393
|
+
const buffer = new ArrayBuffer(this.size);
|
|
2394
|
+
const bytes = new Uint8Array(buffer);
|
|
2395
|
+
let offset = 0;
|
|
2396
|
+
for (const part of this.parts) {
|
|
2397
|
+
bytes.set(part, offset);
|
|
2398
|
+
offset += part.byteLength;
|
|
2399
|
+
}
|
|
2400
|
+
return buffer;
|
|
2401
|
+
}
|
|
2402
|
+
};
|
|
2403
|
+
function readType(input = "") {
|
|
2404
|
+
const type = String(input).toLowerCase();
|
|
2405
|
+
return /[^\u0020-\u007E]/.test(type) ? "" : type;
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
// src/polyfills/file/install-blob-polyfills.ts
|
|
2409
|
+
function instalBlobPolyfills() {
|
|
2410
|
+
if (typeof Blob === "undefined" && !globalThis.Blob) {
|
|
2411
|
+
globalThis.Blob = BlobPolyfill;
|
|
2412
|
+
}
|
|
2413
|
+
return globalThis.Blob;
|
|
2414
|
+
}
|
|
2415
|
+
var Blob_ = instalBlobPolyfills();
|
|
2416
|
+
|
|
2417
|
+
// src/polyfills/file/file-reader.ts
|
|
2418
|
+
var FileReaderPolyfill = class {
|
|
2419
|
+
// onload: ({result: any}) => void;
|
|
2420
|
+
onload;
|
|
2421
|
+
onabort;
|
|
2422
|
+
onerror;
|
|
2423
|
+
error;
|
|
2424
|
+
onloadstart;
|
|
2425
|
+
onloadend;
|
|
2426
|
+
onprogress;
|
|
2427
|
+
readyState;
|
|
2428
|
+
result;
|
|
2429
|
+
DONE;
|
|
2430
|
+
EMPTY;
|
|
2431
|
+
LOADING;
|
|
2432
|
+
addEventListener;
|
|
2433
|
+
removeEventListener;
|
|
2434
|
+
dispatchEvent;
|
|
2435
|
+
constructor() {
|
|
2436
|
+
this.onload = null;
|
|
2437
|
+
}
|
|
2438
|
+
abort() {
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
async readAsArrayBuffer(blob) {
|
|
2442
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
2443
|
+
if (this.onload) {
|
|
2444
|
+
this.onload({ target: { result: arrayBuffer } });
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
async readAsBinaryString(blob) {
|
|
2448
|
+
throw Error("Not implemented");
|
|
2449
|
+
}
|
|
2450
|
+
async readAsDataURL(blob) {
|
|
2451
|
+
const text = await blob.text();
|
|
2452
|
+
const dataUrl = `data://;base64,${atob(text)}`;
|
|
2453
|
+
if (this.onload) {
|
|
2454
|
+
this.onload({ target: { result: dataUrl } });
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
async readAsText(blob) {
|
|
2458
|
+
const text = await blob.text();
|
|
2459
|
+
if (this.onload) {
|
|
2460
|
+
this.onload({ target: { result: text } });
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
};
|
|
2464
|
+
|
|
2465
|
+
// src/polyfills/file/file.ts
|
|
2466
|
+
var FilePolyfill = class extends globalThis.Blob {
|
|
2467
|
+
// implements File {
|
|
2468
|
+
// public API
|
|
2469
|
+
/** The name of the file referenced by the File object. */
|
|
2470
|
+
name = "";
|
|
2471
|
+
/** The path the URL of the File is relative to. */
|
|
2472
|
+
webkitRelativePath = "";
|
|
2473
|
+
/**
|
|
2474
|
+
* Returns the last modified time of the file, in millisecond since the UNIX
|
|
2475
|
+
* epoch (January 1st, 1970 at Midnight).
|
|
2476
|
+
*/
|
|
2477
|
+
lastModified;
|
|
2478
|
+
/**
|
|
2479
|
+
* @param init
|
|
2480
|
+
* @param name - A USVString representing the file name or the path
|
|
2481
|
+
* to the file.
|
|
2482
|
+
* @param [options]
|
|
2483
|
+
*/
|
|
2484
|
+
constructor(init, name, options = {}) {
|
|
2485
|
+
super(init, options);
|
|
2486
|
+
this.name = String(name).replace(/\//g, ":");
|
|
2487
|
+
this.lastModified = options?.lastModified || Date.now();
|
|
2488
|
+
}
|
|
2489
|
+
get [Symbol.toStringTag]() {
|
|
2490
|
+
return "File";
|
|
2491
|
+
}
|
|
2492
|
+
};
|
|
2493
|
+
|
|
2494
|
+
// src/polyfills/file/install-file-polyfills.ts
|
|
2495
|
+
function installFilePolyfills() {
|
|
2496
|
+
if (typeof FileReader === "undefined" && !globalThis.FileReader) {
|
|
2497
|
+
globalThis.FileReader = FileReaderPolyfill;
|
|
2498
|
+
}
|
|
2499
|
+
if (typeof File === "undefined" && !globalThis.File) {
|
|
2500
|
+
globalThis.File = FilePolyfill;
|
|
2501
|
+
}
|
|
2502
|
+
return global;
|
|
2503
|
+
}
|
|
2504
|
+
var File_ = installFilePolyfills();
|
|
2505
|
+
|
|
2506
|
+
// src/polyfills/load-library/require-utils.node.ts
|
|
2507
|
+
var import_module = __toESM(require("module"), 1);
|
|
2508
|
+
var import_path = __toESM(require("path"), 1);
|
|
2509
|
+
var import_fs3 = __toESM(require("fs"), 1);
|
|
2510
|
+
var import_node_url = require("node:url");
|
|
2511
|
+
async function readFileAsArrayBuffer(filename) {
|
|
2512
|
+
if (filename.startsWith("http")) {
|
|
2513
|
+
const response = await fetch(filename);
|
|
2514
|
+
return await response.arrayBuffer();
|
|
2515
|
+
}
|
|
2516
|
+
return ensureArrayBuffer(import_fs3.default.readFileSync(resolveFilePath(filename)));
|
|
2517
|
+
}
|
|
2518
|
+
async function readFileAsText(filename) {
|
|
2519
|
+
if (filename.startsWith("http")) {
|
|
2520
|
+
const response = await fetch(filename);
|
|
2521
|
+
return await response.text();
|
|
2522
|
+
}
|
|
2523
|
+
const text = import_fs3.default.readFileSync(resolveFilePath(filename), "utf8");
|
|
2524
|
+
return text;
|
|
2525
|
+
}
|
|
2526
|
+
async function requireFromFile(filename) {
|
|
2527
|
+
if (filename.startsWith("http")) {
|
|
2528
|
+
const response = await fetch(filename);
|
|
2529
|
+
const code2 = await response.text();
|
|
2530
|
+
return requireFromString(code2);
|
|
2531
|
+
}
|
|
2532
|
+
const filePath = resolveFilePath(filename);
|
|
2533
|
+
const code = import_fs3.default.readFileSync(filePath, "utf8");
|
|
2534
|
+
return requireFromString(code, filePath);
|
|
2535
|
+
}
|
|
2536
|
+
function requireFromString(code, filename = "", options) {
|
|
2537
|
+
if (typeof filename === "object") {
|
|
2538
|
+
options = filename;
|
|
2539
|
+
filename = "";
|
|
2540
|
+
}
|
|
2541
|
+
if (filename.startsWith("file:")) filename = (0, import_node_url.fileURLToPath)(filename);
|
|
2542
|
+
if (typeof code !== "string") {
|
|
2543
|
+
throw new Error(`code must be a string, not ${typeof code}`);
|
|
2544
|
+
}
|
|
2545
|
+
const paths = import_module.default._nodeModulePaths(import_path.default.dirname(filename));
|
|
2546
|
+
const parent = typeof module !== "undefined" && module?.parent;
|
|
2547
|
+
const newModule = new import_module.default(filename, parent);
|
|
2548
|
+
newModule.filename = filename;
|
|
2549
|
+
newModule.paths = [].concat(options?.prependPaths || []).concat(paths).concat(options?.appendPaths || []);
|
|
2550
|
+
newModule._compile(code, filename);
|
|
2551
|
+
if (parent && parent.children) {
|
|
2552
|
+
parent.children.splice(parent.children.indexOf(newModule), 1);
|
|
2553
|
+
}
|
|
2554
|
+
return newModule.exports;
|
|
2555
|
+
}
|
|
2556
|
+
function resolveFilePath(filename) {
|
|
2557
|
+
return filename.startsWith("file:") ? (0, import_node_url.fileURLToPath)(filename) : import_path.default.resolve(filename);
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
// src/polyfills/fetch/headers-polyfill.ts
|
|
2561
|
+
var Headers2 = class _Headers {
|
|
2562
|
+
map;
|
|
2563
|
+
constructor(headers) {
|
|
2564
|
+
this.map = {};
|
|
2565
|
+
if (headers instanceof _Headers) {
|
|
2566
|
+
headers.forEach((value, name) => this.append(name, value));
|
|
2567
|
+
} else if (Array.isArray(headers)) {
|
|
2568
|
+
headers.forEach((header) => this.append(header[0], header[1]));
|
|
2569
|
+
} else if (headers) {
|
|
2570
|
+
Object.getOwnPropertyNames(headers).forEach((name) => this.append(name, headers[name]));
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
append(name, value) {
|
|
2574
|
+
name = normalizeName(name);
|
|
2575
|
+
value = normalizeValue(value);
|
|
2576
|
+
const oldValue = this.map[name];
|
|
2577
|
+
this.map[name] = oldValue ? `${oldValue}, ${value}` : value;
|
|
2578
|
+
}
|
|
2579
|
+
delete(name) {
|
|
2580
|
+
delete this.map[normalizeName(name)];
|
|
2581
|
+
}
|
|
2582
|
+
get(name) {
|
|
2583
|
+
name = normalizeName(name);
|
|
2584
|
+
return this.has(name) ? this.map[name] : null;
|
|
2585
|
+
}
|
|
2586
|
+
has(name) {
|
|
2587
|
+
return this.map.hasOwnProperty(normalizeName(name));
|
|
2588
|
+
}
|
|
2589
|
+
set(name, value) {
|
|
2590
|
+
this.map[normalizeName(name)] = normalizeValue(value);
|
|
2591
|
+
}
|
|
2592
|
+
forEach(visitor, thisArg = null) {
|
|
2593
|
+
for (const name in this.map) {
|
|
2594
|
+
if (this.map.hasOwnProperty(name)) {
|
|
2595
|
+
if (thisArg) {
|
|
2596
|
+
visitor.call(thisArg, this.map[name], name, this);
|
|
2597
|
+
} else {
|
|
2598
|
+
visitor(this.map[name], name, this);
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
keys() {
|
|
2604
|
+
const items = [];
|
|
2605
|
+
this.forEach(function(value, name) {
|
|
2606
|
+
items.push(name);
|
|
2607
|
+
});
|
|
2608
|
+
return iteratorFor(items);
|
|
2609
|
+
}
|
|
2610
|
+
values() {
|
|
2611
|
+
const items = [];
|
|
2612
|
+
this.forEach(function(value) {
|
|
2613
|
+
items.push(value);
|
|
2614
|
+
});
|
|
2615
|
+
return iteratorFor(items);
|
|
2616
|
+
}
|
|
2617
|
+
entries() {
|
|
2618
|
+
const items = [];
|
|
2619
|
+
this.forEach(function(value, name) {
|
|
2620
|
+
items.push([name, value]);
|
|
2621
|
+
});
|
|
2622
|
+
return iteratorFor(items);
|
|
2623
|
+
}
|
|
2624
|
+
*[Symbol.iterator]() {
|
|
2625
|
+
yield* this.entries();
|
|
2626
|
+
}
|
|
2627
|
+
};
|
|
2628
|
+
function normalizeName(name) {
|
|
2629
|
+
if (typeof name !== "string") {
|
|
2630
|
+
name = String(name);
|
|
2631
|
+
}
|
|
2632
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name) || name === "") {
|
|
2633
|
+
throw new TypeError("Invalid character in header field name");
|
|
2634
|
+
}
|
|
2635
|
+
return name.toLowerCase();
|
|
2636
|
+
}
|
|
2637
|
+
function normalizeValue(value) {
|
|
2638
|
+
if (typeof value !== "string") {
|
|
2639
|
+
value = String(value);
|
|
2640
|
+
}
|
|
2641
|
+
return value;
|
|
2642
|
+
}
|
|
2643
|
+
function iteratorFor(items) {
|
|
2644
|
+
const iterator = {
|
|
2645
|
+
next() {
|
|
2646
|
+
const value = items.shift();
|
|
2647
|
+
return { done: value === void 0, value };
|
|
2648
|
+
}
|
|
2649
|
+
};
|
|
2650
|
+
iterator[Symbol.iterator] = function() {
|
|
2651
|
+
return iterator;
|
|
2652
|
+
};
|
|
2653
|
+
return iterator;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
// src/polyfills/utils/assert.ts
|
|
2657
|
+
function assert(condition, message) {
|
|
2658
|
+
if (!condition) {
|
|
2659
|
+
throw new Error(`@loaders.gl/core/polyfills assertion ${message}`);
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
// src/polyfills/fetch/response-polyfill.ts
|
|
2664
|
+
var stream = __toESM(require("stream"), 1);
|
|
2665
|
+
var isBoolean2 = (x) => typeof x === "boolean";
|
|
2666
|
+
var isFunction2 = (x) => typeof x === "function";
|
|
2667
|
+
var isObject2 = (x) => x !== null && typeof x === "object";
|
|
2668
|
+
var isReadableNodeStream2 = (x) => isObject2(x) && isFunction2(x.read) && isFunction2(x.pipe) && isBoolean2(x.readable);
|
|
2669
|
+
var Response2 = class {
|
|
2670
|
+
ok;
|
|
2671
|
+
status;
|
|
2672
|
+
statusText;
|
|
2673
|
+
headers;
|
|
2674
|
+
url;
|
|
2675
|
+
bodyUsed = false;
|
|
2676
|
+
_body;
|
|
2677
|
+
// TODO - handle ArrayBuffer, ArrayBufferView, Buffer
|
|
2678
|
+
constructor(body, options) {
|
|
2679
|
+
const { headers, status = 200, statusText = "OK", url } = options || {};
|
|
2680
|
+
this.url = url;
|
|
2681
|
+
this.ok = status === 200;
|
|
2682
|
+
this.status = status;
|
|
2683
|
+
this.statusText = statusText;
|
|
2684
|
+
this.headers = new Headers2(options?.headers || {});
|
|
2685
|
+
if (isReadableNodeStream2(body)) {
|
|
2686
|
+
this._body = decompressReadStream(body, headers);
|
|
2687
|
+
} else if (typeof body === "string") {
|
|
2688
|
+
this._body = stream.Readable.from([new TextEncoder().encode(body)]);
|
|
2689
|
+
} else {
|
|
2690
|
+
this._body = stream.Readable.from([body || new ArrayBuffer(0)]);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
// Subset of Properties
|
|
2694
|
+
// Returns a readable stream to the "body" of the response (or file)
|
|
2695
|
+
get body() {
|
|
2696
|
+
assert(!this.bodyUsed);
|
|
2697
|
+
assert(isReadableNodeStream2(this._body));
|
|
2698
|
+
this.bodyUsed = true;
|
|
2699
|
+
return this._body;
|
|
2700
|
+
}
|
|
2701
|
+
// Subset of Methods
|
|
2702
|
+
async arrayBuffer() {
|
|
2703
|
+
if (!isReadableNodeStream2(this._body)) {
|
|
2704
|
+
return this._body || new ArrayBuffer(0);
|
|
2705
|
+
}
|
|
2706
|
+
const data = await concatenateReadStream(this._body);
|
|
2707
|
+
return data;
|
|
2708
|
+
}
|
|
2709
|
+
async text() {
|
|
2710
|
+
const arrayBuffer = await this.arrayBuffer();
|
|
2711
|
+
const textDecoder = new TextDecoder();
|
|
2712
|
+
return textDecoder.decode(arrayBuffer);
|
|
2713
|
+
}
|
|
2714
|
+
async json() {
|
|
2715
|
+
const text = await this.text();
|
|
2716
|
+
return JSON.parse(text);
|
|
2717
|
+
}
|
|
2718
|
+
async blob() {
|
|
2719
|
+
if (typeof Blob === "undefined") {
|
|
2720
|
+
throw new Error("Blob polyfill not installed");
|
|
2721
|
+
}
|
|
2722
|
+
return new Blob([await this.arrayBuffer()]);
|
|
2723
|
+
}
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
// src/polyfills/fetch/fetch-polyfill.ts
|
|
2727
|
+
var import_http = __toESM(require("http"), 1);
|
|
2728
|
+
var import_https = __toESM(require("https"), 1);
|
|
2729
|
+
|
|
2730
|
+
// src/polyfills/fetch/decode-data-uri.ts
|
|
2731
|
+
function decodeDataUri(uri) {
|
|
2732
|
+
const dataIndex = uri.indexOf(",");
|
|
2733
|
+
let buffer;
|
|
2734
|
+
let mimeType;
|
|
2735
|
+
if (uri.slice(dataIndex - 7, dataIndex) === ";base64") {
|
|
2736
|
+
buffer = Buffer.from(uri.slice(dataIndex + 1), "base64");
|
|
2737
|
+
mimeType = uri.slice(5, dataIndex - 7).trim();
|
|
2738
|
+
} else {
|
|
2739
|
+
buffer = Buffer.from(decodeURIComponent(uri.slice(dataIndex + 1)));
|
|
2740
|
+
mimeType = uri.slice(5, dataIndex).trim();
|
|
2741
|
+
}
|
|
2742
|
+
if (!mimeType) {
|
|
2743
|
+
mimeType = "text/plain;charset=US-ASCII";
|
|
2744
|
+
} else if (mimeType.startsWith(";")) {
|
|
2745
|
+
mimeType = `text/plain${mimeType}`;
|
|
2746
|
+
}
|
|
2747
|
+
return { arrayBuffer: toArrayBuffer(buffer), mimeType };
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
// src/polyfills/fetch/fetch-polyfill.ts
|
|
2751
|
+
var isDataURL = (url) => url.startsWith("data:");
|
|
2752
|
+
var isRequestURL = (url) => url.startsWith("http:") || url.startsWith("https:");
|
|
2753
|
+
async function fetchNode2(url, options) {
|
|
2754
|
+
try {
|
|
2755
|
+
if (globalThis.fetch !== fetchNode2 && (isRequestURL(url) || isDataURL(url))) {
|
|
2756
|
+
return await fetch(url, options);
|
|
2757
|
+
}
|
|
2758
|
+
if (isDataURL(url)) {
|
|
2759
|
+
const { arrayBuffer, mimeType } = decodeDataUri(url);
|
|
2760
|
+
const response = new Response2(arrayBuffer, {
|
|
2761
|
+
headers: { "content-type": mimeType },
|
|
2762
|
+
url
|
|
2763
|
+
});
|
|
2764
|
+
return response;
|
|
2765
|
+
}
|
|
2766
|
+
const syntheticResponseHeaders = {};
|
|
2767
|
+
const originalUrl = url;
|
|
2768
|
+
if (url.endsWith(".gz")) {
|
|
2769
|
+
url = url.slice(0, -3);
|
|
2770
|
+
syntheticResponseHeaders["content-encoding"] = "gzip";
|
|
2771
|
+
}
|
|
2772
|
+
const body = await createHTTPRequestReadStream(originalUrl, options);
|
|
2773
|
+
const headers = getHeaders(url, body, syntheticResponseHeaders);
|
|
2774
|
+
const { status, statusText } = getStatus(body);
|
|
2775
|
+
const followRedirect = (
|
|
2776
|
+
// @ts-expect-error
|
|
2777
|
+
!options || options.followRedirect || options.followRedirect === void 0
|
|
2778
|
+
);
|
|
2779
|
+
if (status >= 300 && status < 400 && headers.has("location") && followRedirect) {
|
|
2780
|
+
const redirectUrl = generateRedirectUrl(url, headers.get("location"));
|
|
2781
|
+
return await fetchNode2(redirectUrl, options);
|
|
2782
|
+
}
|
|
2783
|
+
return new Response2(body, { headers, status, statusText, url });
|
|
2784
|
+
} catch (error) {
|
|
2785
|
+
return new Response2(null, { status: 400, statusText: String(error), url });
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
async function createHTTPRequestReadStream(url, options) {
|
|
2789
|
+
return await new Promise((resolve, reject) => {
|
|
2790
|
+
const requestOptions = getRequestOptions(url, options);
|
|
2791
|
+
const req = url.startsWith("https:") ? import_https.default.request(requestOptions, (res) => resolve(res)) : import_http.default.request(requestOptions, (res) => resolve(res));
|
|
2792
|
+
req.on("error", (error) => reject(error));
|
|
2793
|
+
req.end();
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
function generateRedirectUrl(originalUrl, location) {
|
|
2797
|
+
if (location.startsWith("http")) {
|
|
2798
|
+
return location;
|
|
2799
|
+
}
|
|
2800
|
+
const url = new URL(originalUrl);
|
|
2801
|
+
url.pathname = location;
|
|
2802
|
+
return url.href;
|
|
2803
|
+
}
|
|
2804
|
+
function getRequestOptions(url, options) {
|
|
2805
|
+
const originalHeaders = options?.headers || {};
|
|
2806
|
+
const headers = {};
|
|
2807
|
+
for (const key of Object.keys(originalHeaders)) {
|
|
2808
|
+
headers[key.toLowerCase()] = originalHeaders[key];
|
|
2809
|
+
}
|
|
2810
|
+
headers["accept-encoding"] = headers["accept-encoding"] || "gzip,br,deflate";
|
|
2811
|
+
const urlObject = new URL(url);
|
|
2812
|
+
return {
|
|
2813
|
+
hostname: urlObject.hostname,
|
|
2814
|
+
path: urlObject.pathname,
|
|
2815
|
+
method: "GET",
|
|
2816
|
+
// Add options and user provided 'options.fetch' overrides if available
|
|
2817
|
+
...options,
|
|
2818
|
+
...options?.fetch,
|
|
2819
|
+
// Override with updated headers with accepted encodings:
|
|
2820
|
+
headers,
|
|
2821
|
+
port: urlObject.port
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
function getStatus(httpResponse) {
|
|
2825
|
+
if (httpResponse.statusCode) {
|
|
2826
|
+
return { status: httpResponse.statusCode, statusText: httpResponse.statusMessage || "NA" };
|
|
2827
|
+
}
|
|
2828
|
+
return { status: 200, statusText: "OK" };
|
|
2829
|
+
}
|
|
2830
|
+
function getHeaders(url, httpResponse, additionalHeaders = {}) {
|
|
2831
|
+
const headers = {};
|
|
2832
|
+
if (httpResponse && httpResponse.headers) {
|
|
2833
|
+
const httpHeaders = httpResponse.headers;
|
|
2834
|
+
for (const key in httpHeaders) {
|
|
2835
|
+
const header = httpHeaders[key];
|
|
2836
|
+
headers[key.toLowerCase()] = String(header);
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
if (!headers["content-length"]) {
|
|
2840
|
+
const contentLength = getContentLength(url);
|
|
2841
|
+
if (Number.isFinite(contentLength)) {
|
|
2842
|
+
headers["content-length"] = contentLength;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
Object.assign(headers, additionalHeaders);
|
|
2846
|
+
return new Headers2(headers);
|
|
2847
|
+
}
|
|
2848
|
+
function getContentLength(url) {
|
|
2849
|
+
return isDataURL(url) ? url.length - "data:".length : null;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
// src/polyfills/index.ts
|
|
2853
|
+
var nodeVersion = parseInt(import_node_process.versions.node.split(".")[0]);
|
|
2854
|
+
if (isBrowser) {
|
|
2855
|
+
console.error(
|
|
2856
|
+
"loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments"
|
|
2857
|
+
);
|
|
2858
|
+
}
|
|
2859
|
+
globalThis.loaders = globalThis.loaders || {};
|
|
2860
|
+
globalThis.loaders.makeNodeStream = makeNodeStream;
|
|
2861
|
+
globalThis.loaders.NodeFile = NodeFile;
|
|
2862
|
+
globalThis.loaders.NodeFileSystem = NodeFileSystem;
|
|
2863
|
+
globalThis.loaders.fetchNode = fetchNode;
|
|
2864
|
+
globalThis.loaders.NodeHash = NodeHash;
|
|
2865
|
+
if (!globalThis.TextEncoder) {
|
|
2866
|
+
globalThis.TextEncoder = TextEncoder2;
|
|
2867
|
+
}
|
|
2868
|
+
if (!globalThis.TextDecoder) {
|
|
2869
|
+
globalThis.TextDecoder = TextDecoder2;
|
|
2870
|
+
}
|
|
2871
|
+
if (!globalThis.ReadableStream) {
|
|
2872
|
+
globalThis.ReadableStream = import_web2.ReadableStream;
|
|
2873
|
+
}
|
|
2874
|
+
if (!("atob" in globalThis) && atob) {
|
|
2875
|
+
globalThis["atob"] = atob;
|
|
2876
|
+
}
|
|
2877
|
+
if (!("btoa" in globalThis) && btoa) {
|
|
2878
|
+
globalThis["btoa"] = btoa;
|
|
2879
|
+
}
|
|
2880
|
+
globalThis.loaders.encodeImageNode = encodeImageNode2;
|
|
2881
|
+
globalThis.loaders.parseImageNode = parseImageNode2;
|
|
2882
|
+
globalThis.loaders.imageFormatsNode = NODE_FORMAT_SUPPORT;
|
|
2883
|
+
globalThis.loaders.createImageBitmapNode = createImageBitmapNode;
|
|
2884
|
+
globalThis.loaders.getImageBitmapDataNode = getImageBitmapDataNode;
|
|
2885
|
+
globalThis.loaders.isImageBitmapNode = isNodeImageBitmap;
|
|
2886
|
+
if (!globalThis.ImageBitmap) {
|
|
2887
|
+
globalThis.ImageBitmap = NodeImageBitmap;
|
|
2888
|
+
}
|
|
2889
|
+
if (!("getImageBitmapData" in globalThis)) {
|
|
2890
|
+
globalThis.getImageBitmapData = getImageBitmapDataNode;
|
|
2891
|
+
}
|
|
2892
|
+
globalThis._parseImageNode = parseImageNode2;
|
|
2893
|
+
globalThis._imageFormatsNode = NODE_FORMAT_SUPPORT;
|
|
2894
|
+
globalThis.loaders.readFileAsArrayBuffer = readFileAsArrayBuffer;
|
|
2895
|
+
globalThis.loaders.readFileAsText = readFileAsText;
|
|
2896
|
+
globalThis.loaders.requireFromFile = requireFromFile;
|
|
2897
|
+
globalThis.loaders.requireFromString = requireFromString;
|
|
2898
|
+
if (nodeVersion < 18) {
|
|
2899
|
+
if (!("Headers" in globalThis) && Headers2) {
|
|
2900
|
+
globalThis.Headers = Headers2;
|
|
2901
|
+
}
|
|
2902
|
+
if (!("Response" in globalThis) && Response2) {
|
|
2903
|
+
globalThis.Response = Response2;
|
|
2904
|
+
}
|
|
2905
|
+
if (!("fetch" in globalThis) && fetchNode2) {
|
|
2906
|
+
globalThis.fetch = fetchNode2;
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2910
|
+
0 && (module.exports = {
|
|
2911
|
+
Blob,
|
|
2912
|
+
File,
|
|
2913
|
+
addAliases,
|
|
2914
|
+
installFilePolyfills,
|
|
2915
|
+
makeNodeStream,
|
|
2916
|
+
nodeVersion,
|
|
2917
|
+
setPathPrefix
|
|
2918
|
+
});
|