@loaders.gl/scan 5.0.0-alpha.10 → 5.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/delta.cjs CHANGED
@@ -14099,6 +14099,127 @@ var init_parquet_source_loader_types = __esm({
14099
14099
  }
14100
14100
  });
14101
14101
 
14102
+ // ../compression/src/lib/native-decompressor.ts
14103
+ var native_decompressor_exports = {};
14104
+ __export(native_decompressor_exports, {
14105
+ NativeDecompressor: () => NativeDecompressor
14106
+ });
14107
+ var NativeDecompressor;
14108
+ var init_native_decompressor = __esm({
14109
+ "../compression/src/lib/native-decompressor.ts"() {
14110
+ "use strict";
14111
+ init_compression();
14112
+ init_decompression_stream();
14113
+ NativeDecompressor = class extends Decompressor {
14114
+ name;
14115
+ extensions;
14116
+ contentEncodings;
14117
+ isSupported = true;
14118
+ /** Runtime stream format used for every operation. */
14119
+ format;
14120
+ constructor(metadata, format, options = {}) {
14121
+ super(options);
14122
+ this.name = metadata.name;
14123
+ this.extensions = [...metadata.extensions];
14124
+ this.contentEncodings = [...metadata.contentEncodings];
14125
+ this.format = format;
14126
+ }
14127
+ /** Decompresses one buffer with the runtime-provided stream. */
14128
+ async decompress(input) {
14129
+ const output = await decompressWithNativeDecompressionStream(input, this.format);
14130
+ if (!output) throw new Error(`${this.name}: built-in decompression is no longer available`);
14131
+ return output;
14132
+ }
14133
+ /** Decompresses batches incrementally with the runtime-provided stream. */
14134
+ async *decompressBatches(inputBatches) {
14135
+ const output = decompressBatchesWithNativeDecompressionStream(inputBatches, this.format);
14136
+ if (!output) throw new Error(`${this.name}: built-in decompression is no longer available`);
14137
+ yield* output;
14138
+ }
14139
+ };
14140
+ }
14141
+ });
14142
+
14143
+ // ../compression/src/lib/lazy-compression.ts
14144
+ function mergeModules(options, modules) {
14145
+ return { ...options, modules: { ...options.modules, ...modules } };
14146
+ }
14147
+ var LazyDecompressor;
14148
+ var init_lazy_compression = __esm({
14149
+ "../compression/src/lib/lazy-compression.ts"() {
14150
+ "use strict";
14151
+ init_compression();
14152
+ init_decompression_stream();
14153
+ LazyDecompressor = class extends Decompressor {
14154
+ name;
14155
+ extensions;
14156
+ contentEncodings;
14157
+ isSupported = true;
14158
+ /** Constructor options retained until a concrete implementation is selected. */
14159
+ options;
14160
+ /** Built-in stream format to probe, or null when the format has no built-in path. */
14161
+ nativeFormat;
14162
+ /** Returns whether built-in selection remains eligible for the merged preload options. */
14163
+ shouldUseNative;
14164
+ /** Dynamically imports the balanced fallback constructor. */
14165
+ loadFallback;
14166
+ /** Selected concrete implementation after preload completes. */
14167
+ implementation = null;
14168
+ /** Shared in-flight selection used by concurrent asynchronous calls. */
14169
+ implementationPromise = null;
14170
+ constructor(metadata, loadFallback, options = {}, nativeFormat = null, shouldUseNative = () => true) {
14171
+ super(options);
14172
+ this.name = metadata.name;
14173
+ this.extensions = [...metadata.extensions];
14174
+ this.contentEncodings = [...metadata.contentEncodings];
14175
+ this.options = options;
14176
+ this.nativeFormat = nativeFormat;
14177
+ this.shouldUseNative = shouldUseNative;
14178
+ this.loadFallback = loadFallback;
14179
+ }
14180
+ /** Selects and returns the built-in or dynamically imported fallback decompressor. */
14181
+ async preload(modules = {}) {
14182
+ if (this.implementation) return this.implementation;
14183
+ const options = mergeModules(this.options, modules);
14184
+ this.implementationPromise ||= this.loadImplementation(options);
14185
+ try {
14186
+ this.implementation = await this.implementationPromise;
14187
+ return this.implementation;
14188
+ } catch (error) {
14189
+ this.implementationPromise = null;
14190
+ throw error;
14191
+ }
14192
+ }
14193
+ /** Loads the selected concrete decompressor. */
14194
+ async loadImplementation(options) {
14195
+ if (options.useNative !== false && this.nativeFormat && this.shouldUseNative(options) && isNativeDecompressionSupported(this.nativeFormat)) {
14196
+ const { NativeDecompressor: NativeDecompressor2 } = await Promise.resolve().then(() => (init_native_decompressor(), native_decompressor_exports));
14197
+ return new NativeDecompressor2(this, this.nativeFormat, options);
14198
+ }
14199
+ const Decompressor2 = await this.loadFallback();
14200
+ const implementation = new Decompressor2({ ...options, useNative: false });
14201
+ await implementation.preload(options.modules);
14202
+ return implementation;
14203
+ }
14204
+ /** Decompresses after lazily selecting the default implementation. */
14205
+ async decompress(input, size) {
14206
+ return (await this.preload()).decompress(input, size);
14207
+ }
14208
+ /** Decompresses synchronously after an implementation has been preloaded. */
14209
+ decompressSync(input, size) {
14210
+ if (!this.implementation) {
14211
+ throw new Error(`${this.name}: call preload() before decompressSync()`);
14212
+ }
14213
+ return this.implementation.decompressSync(input, size);
14214
+ }
14215
+ /** Decompresses batches after lazily selecting the default implementation. */
14216
+ async *decompressBatches(inputBatches) {
14217
+ yield* (await this.preload()).decompressBatches(inputBatches);
14218
+ }
14219
+ };
14220
+ }
14221
+ });
14222
+
14102
14223
  // ../compression/src/lib/fflate/index.ts
14103
14224
  function gunzipSync(data, out) {
14104
14225
  return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));
@@ -14507,127 +14628,6 @@ var init_fflate = __esm({
14507
14628
  }
14508
14629
  });
14509
14630
 
14510
- // ../compression/src/lib/native-decompressor.ts
14511
- var native_decompressor_exports = {};
14512
- __export(native_decompressor_exports, {
14513
- NativeDecompressor: () => NativeDecompressor
14514
- });
14515
- var NativeDecompressor;
14516
- var init_native_decompressor = __esm({
14517
- "../compression/src/lib/native-decompressor.ts"() {
14518
- "use strict";
14519
- init_compression();
14520
- init_decompression_stream();
14521
- NativeDecompressor = class extends Decompressor {
14522
- name;
14523
- extensions;
14524
- contentEncodings;
14525
- isSupported = true;
14526
- /** Runtime stream format used for every operation. */
14527
- format;
14528
- constructor(metadata, format, options = {}) {
14529
- super(options);
14530
- this.name = metadata.name;
14531
- this.extensions = [...metadata.extensions];
14532
- this.contentEncodings = [...metadata.contentEncodings];
14533
- this.format = format;
14534
- }
14535
- /** Decompresses one buffer with the runtime-provided stream. */
14536
- async decompress(input) {
14537
- const output = await decompressWithNativeDecompressionStream(input, this.format);
14538
- if (!output) throw new Error(`${this.name}: built-in decompression is no longer available`);
14539
- return output;
14540
- }
14541
- /** Decompresses batches incrementally with the runtime-provided stream. */
14542
- async *decompressBatches(inputBatches) {
14543
- const output = decompressBatchesWithNativeDecompressionStream(inputBatches, this.format);
14544
- if (!output) throw new Error(`${this.name}: built-in decompression is no longer available`);
14545
- yield* output;
14546
- }
14547
- };
14548
- }
14549
- });
14550
-
14551
- // ../compression/src/lib/lazy-compression.ts
14552
- function mergeModules(options, modules) {
14553
- return { ...options, modules: { ...options.modules, ...modules } };
14554
- }
14555
- var LazyDecompressor;
14556
- var init_lazy_compression = __esm({
14557
- "../compression/src/lib/lazy-compression.ts"() {
14558
- "use strict";
14559
- init_compression();
14560
- init_decompression_stream();
14561
- LazyDecompressor = class extends Decompressor {
14562
- name;
14563
- extensions;
14564
- contentEncodings;
14565
- isSupported = true;
14566
- /** Constructor options retained until a concrete implementation is selected. */
14567
- options;
14568
- /** Built-in stream format to probe, or null when the format has no built-in path. */
14569
- nativeFormat;
14570
- /** Returns whether built-in selection remains eligible for the merged preload options. */
14571
- shouldUseNative;
14572
- /** Dynamically imports the balanced fallback constructor. */
14573
- loadFallback;
14574
- /** Selected concrete implementation after preload completes. */
14575
- implementation = null;
14576
- /** Shared in-flight selection used by concurrent asynchronous calls. */
14577
- implementationPromise = null;
14578
- constructor(metadata, loadFallback, options = {}, nativeFormat = null, shouldUseNative = () => true) {
14579
- super(options);
14580
- this.name = metadata.name;
14581
- this.extensions = [...metadata.extensions];
14582
- this.contentEncodings = [...metadata.contentEncodings];
14583
- this.options = options;
14584
- this.nativeFormat = nativeFormat;
14585
- this.shouldUseNative = shouldUseNative;
14586
- this.loadFallback = loadFallback;
14587
- }
14588
- /** Selects and returns the built-in or dynamically imported fallback decompressor. */
14589
- async preload(modules = {}) {
14590
- if (this.implementation) return this.implementation;
14591
- const options = mergeModules(this.options, modules);
14592
- this.implementationPromise ||= this.loadImplementation(options);
14593
- try {
14594
- this.implementation = await this.implementationPromise;
14595
- return this.implementation;
14596
- } catch (error) {
14597
- this.implementationPromise = null;
14598
- throw error;
14599
- }
14600
- }
14601
- /** Loads the selected concrete decompressor. */
14602
- async loadImplementation(options) {
14603
- if (options.useNative !== false && this.nativeFormat && this.shouldUseNative(options) && isNativeDecompressionSupported(this.nativeFormat)) {
14604
- const { NativeDecompressor: NativeDecompressor2 } = await Promise.resolve().then(() => (init_native_decompressor(), native_decompressor_exports));
14605
- return new NativeDecompressor2(this, this.nativeFormat, options);
14606
- }
14607
- const Decompressor2 = await this.loadFallback();
14608
- const implementation = new Decompressor2({ ...options, useNative: false });
14609
- await implementation.preload(options.modules);
14610
- return implementation;
14611
- }
14612
- /** Decompresses after lazily selecting the default implementation. */
14613
- async decompress(input, size) {
14614
- return (await this.preload()).decompress(input, size);
14615
- }
14616
- /** Decompresses synchronously after an implementation has been preloaded. */
14617
- decompressSync(input, size) {
14618
- if (!this.implementation) {
14619
- throw new Error(`${this.name}: call preload() before decompressSync()`);
14620
- }
14621
- return this.implementation.decompressSync(input, size);
14622
- }
14623
- /** Decompresses batches after lazily selecting the default implementation. */
14624
- async *decompressBatches(inputBatches) {
14625
- yield* (await this.preload()).decompressBatches(inputBatches);
14626
- }
14627
- };
14628
- }
14629
- });
14630
-
14631
14631
  // ../compression/src/lib/fflate-stream.ts
14632
14632
  async function* transformFflateBatches(processor, inputBatches) {
14633
14633
  const chunks = [];