@vitessce/zarr 3.6.18 → 3.7.0
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/index.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __typeError = (msg) => {
|
|
2
|
-
throw TypeError(msg);
|
|
3
|
-
};
|
|
4
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
7
|
-
var __privateSet = (obj, member, value, setter2) => (__accessCheck(obj, member, "write to private field"), setter2 ? setter2.call(obj, value) : member.set(obj, value), value);
|
|
8
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
9
|
-
var _overrides, _use_suffix_request, _FetchStore_instances, merge_init_fn, _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _metadata2, _a2, _overrides2, _refs, _opts, _overrides3;
|
|
10
1
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
11
2
|
function getDefaultExportFromCjs(x) {
|
|
12
3
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -16,7 +7,12 @@ function getAugmentedNamespace(n) {
|
|
|
16
7
|
var f = n.default;
|
|
17
8
|
if (typeof f == "function") {
|
|
18
9
|
var a = function a2() {
|
|
19
|
-
|
|
10
|
+
var isInstance = false;
|
|
11
|
+
try {
|
|
12
|
+
isInstance = this instanceof a2;
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
if (isInstance) {
|
|
20
16
|
return Reflect.construct(f, arguments, this.constructor);
|
|
21
17
|
}
|
|
22
18
|
return f.apply(this, arguments);
|
|
@@ -366,72 +362,68 @@ async function fetch_suffix(url, suffix_length, init, use_suffix_request) {
|
|
|
366
362
|
return fetch_range(url, length - suffix_length, length, init);
|
|
367
363
|
}
|
|
368
364
|
class FetchStore {
|
|
365
|
+
#overrides;
|
|
366
|
+
#use_suffix_request;
|
|
369
367
|
constructor(url, options = {}) {
|
|
370
|
-
__privateAdd(this, _FetchStore_instances);
|
|
371
|
-
__privateAdd(this, _overrides);
|
|
372
|
-
__privateAdd(this, _use_suffix_request);
|
|
373
368
|
this.url = url;
|
|
374
|
-
|
|
375
|
-
|
|
369
|
+
this.#overrides = options.overrides ?? {};
|
|
370
|
+
this.#use_suffix_request = options.useSuffixRequest ?? false;
|
|
371
|
+
}
|
|
372
|
+
#merge_init(overrides) {
|
|
373
|
+
return merge_init(this.#overrides, overrides);
|
|
376
374
|
}
|
|
377
375
|
async get(key, options = {}) {
|
|
378
376
|
let href = resolve(this.url, key).href;
|
|
379
|
-
let response = await fetch(href,
|
|
377
|
+
let response = await fetch(href, this.#merge_init(options));
|
|
380
378
|
return handle_response(response);
|
|
381
379
|
}
|
|
382
380
|
async getRange(key, range2, options = {}) {
|
|
383
381
|
let url = resolve(this.url, key);
|
|
384
|
-
let init =
|
|
382
|
+
let init = this.#merge_init(options);
|
|
385
383
|
let response;
|
|
386
384
|
if ("suffixLength" in range2) {
|
|
387
|
-
response = await fetch_suffix(url, range2.suffixLength, init,
|
|
385
|
+
response = await fetch_suffix(url, range2.suffixLength, init, this.#use_suffix_request);
|
|
388
386
|
} else {
|
|
389
387
|
response = await fetch_range(url, range2.offset, range2.length, init);
|
|
390
388
|
}
|
|
391
389
|
return handle_response(response);
|
|
392
390
|
}
|
|
393
391
|
}
|
|
394
|
-
_overrides = new WeakMap();
|
|
395
|
-
_use_suffix_request = new WeakMap();
|
|
396
|
-
_FetchStore_instances = new WeakSet();
|
|
397
|
-
merge_init_fn = function(overrides) {
|
|
398
|
-
return merge_init(__privateGet(this, _overrides), overrides);
|
|
399
|
-
};
|
|
400
392
|
class BoolArray {
|
|
393
|
+
#bytes;
|
|
401
394
|
constructor(x, byteOffset, length) {
|
|
402
|
-
__privateAdd(this, _bytes);
|
|
403
395
|
if (typeof x === "number") {
|
|
404
|
-
|
|
396
|
+
this.#bytes = new Uint8Array(x);
|
|
405
397
|
} else if (x instanceof ArrayBuffer) {
|
|
406
|
-
|
|
398
|
+
this.#bytes = new Uint8Array(x, byteOffset, length);
|
|
407
399
|
} else {
|
|
408
|
-
|
|
400
|
+
this.#bytes = new Uint8Array(Array.from(x, (v) => v ? 1 : 0));
|
|
409
401
|
}
|
|
410
402
|
}
|
|
411
403
|
get BYTES_PER_ELEMENT() {
|
|
412
404
|
return 1;
|
|
413
405
|
}
|
|
414
406
|
get byteOffset() {
|
|
415
|
-
return
|
|
407
|
+
return this.#bytes.byteOffset;
|
|
416
408
|
}
|
|
417
409
|
get byteLength() {
|
|
418
|
-
return
|
|
410
|
+
return this.#bytes.byteLength;
|
|
419
411
|
}
|
|
420
412
|
get buffer() {
|
|
421
|
-
return
|
|
413
|
+
return this.#bytes.buffer;
|
|
422
414
|
}
|
|
423
415
|
get length() {
|
|
424
|
-
return
|
|
416
|
+
return this.#bytes.length;
|
|
425
417
|
}
|
|
426
418
|
get(idx) {
|
|
427
|
-
let value =
|
|
419
|
+
let value = this.#bytes[idx];
|
|
428
420
|
return typeof value === "number" ? value !== 0 : value;
|
|
429
421
|
}
|
|
430
422
|
set(idx, value) {
|
|
431
|
-
|
|
423
|
+
this.#bytes[idx] = value ? 1 : 0;
|
|
432
424
|
}
|
|
433
425
|
fill(value) {
|
|
434
|
-
|
|
426
|
+
this.#bytes.fill(value ? 1 : 0);
|
|
435
427
|
}
|
|
436
428
|
*[Symbol.iterator]() {
|
|
437
429
|
for (let i = 0; i < this.length; i++) {
|
|
@@ -439,12 +431,11 @@ class BoolArray {
|
|
|
439
431
|
}
|
|
440
432
|
}
|
|
441
433
|
}
|
|
442
|
-
_bytes = new WeakMap();
|
|
443
434
|
class ByteStringArray {
|
|
435
|
+
#encoder;
|
|
444
436
|
constructor(chars, x, byteOffset, length) {
|
|
445
|
-
__privateAdd(this, _encoder);
|
|
446
437
|
this.chars = chars;
|
|
447
|
-
|
|
438
|
+
this.#encoder = new TextEncoder();
|
|
448
439
|
if (typeof x === "number") {
|
|
449
440
|
this._data = new Uint8Array(x * chars);
|
|
450
441
|
} else if (x instanceof ArrayBuffer) {
|
|
@@ -481,10 +472,10 @@ class ByteStringArray {
|
|
|
481
472
|
set(idx, value) {
|
|
482
473
|
const view = new Uint8Array(this.buffer, this.byteOffset + this.chars * idx, this.chars);
|
|
483
474
|
view.fill(0);
|
|
484
|
-
view.set(
|
|
475
|
+
view.set(this.#encoder.encode(value));
|
|
485
476
|
}
|
|
486
477
|
fill(value) {
|
|
487
|
-
const encoded =
|
|
478
|
+
const encoded = this.#encoder.encode(value);
|
|
488
479
|
for (let i = 0; i < this.length; i++) {
|
|
489
480
|
this._data.set(encoded, i * this.chars);
|
|
490
481
|
}
|
|
@@ -495,54 +486,53 @@ class ByteStringArray {
|
|
|
495
486
|
}
|
|
496
487
|
}
|
|
497
488
|
}
|
|
498
|
-
|
|
499
|
-
|
|
489
|
+
class UnicodeStringArray {
|
|
490
|
+
#data;
|
|
500
491
|
constructor(chars, x, byteOffset, length) {
|
|
501
|
-
__privateAdd(this, _data);
|
|
502
492
|
this.chars = chars;
|
|
503
493
|
if (typeof x === "number") {
|
|
504
|
-
|
|
494
|
+
this.#data = new Int32Array(x * chars);
|
|
505
495
|
} else if (x instanceof ArrayBuffer) {
|
|
506
496
|
if (length)
|
|
507
497
|
length *= chars;
|
|
508
|
-
|
|
498
|
+
this.#data = new Int32Array(x, byteOffset, length);
|
|
509
499
|
} else {
|
|
510
500
|
const values = x;
|
|
511
|
-
const d = new
|
|
512
|
-
|
|
501
|
+
const d = new UnicodeStringArray(chars, 1);
|
|
502
|
+
this.#data = new Int32Array(function* () {
|
|
513
503
|
for (let str of values) {
|
|
514
504
|
d.set(0, str);
|
|
515
|
-
yield*
|
|
505
|
+
yield* d.#data;
|
|
516
506
|
}
|
|
517
|
-
}())
|
|
507
|
+
}());
|
|
518
508
|
}
|
|
519
509
|
}
|
|
520
510
|
get BYTES_PER_ELEMENT() {
|
|
521
|
-
return
|
|
511
|
+
return this.#data.BYTES_PER_ELEMENT * this.chars;
|
|
522
512
|
}
|
|
523
513
|
get byteLength() {
|
|
524
|
-
return
|
|
514
|
+
return this.#data.byteLength;
|
|
525
515
|
}
|
|
526
516
|
get byteOffset() {
|
|
527
|
-
return
|
|
517
|
+
return this.#data.byteOffset;
|
|
528
518
|
}
|
|
529
519
|
get buffer() {
|
|
530
|
-
return
|
|
520
|
+
return this.#data.buffer;
|
|
531
521
|
}
|
|
532
522
|
get length() {
|
|
533
|
-
return
|
|
523
|
+
return this.#data.length / this.chars;
|
|
534
524
|
}
|
|
535
525
|
get(idx) {
|
|
536
526
|
const offset = this.chars * idx;
|
|
537
527
|
let result = "";
|
|
538
528
|
for (let i = 0; i < this.chars; i++) {
|
|
539
|
-
result += String.fromCodePoint(
|
|
529
|
+
result += String.fromCodePoint(this.#data[offset + i]);
|
|
540
530
|
}
|
|
541
531
|
return result.replace(/\u0000/g, "");
|
|
542
532
|
}
|
|
543
533
|
set(idx, value) {
|
|
544
534
|
const offset = this.chars * idx;
|
|
545
|
-
const view =
|
|
535
|
+
const view = this.#data.subarray(offset, offset + this.chars);
|
|
546
536
|
view.fill(0);
|
|
547
537
|
for (let i = 0; i < this.chars; i++) {
|
|
548
538
|
view[i] = value.codePointAt(i) ?? 0;
|
|
@@ -550,9 +540,9 @@ const _UnicodeStringArray = class _UnicodeStringArray {
|
|
|
550
540
|
}
|
|
551
541
|
fill(value) {
|
|
552
542
|
this.set(0, value);
|
|
553
|
-
let encoded =
|
|
543
|
+
let encoded = this.#data.subarray(0, this.chars);
|
|
554
544
|
for (let i = 1; i < this.length; i++) {
|
|
555
|
-
|
|
545
|
+
this.#data.set(encoded, i * this.chars);
|
|
556
546
|
}
|
|
557
547
|
}
|
|
558
548
|
*[Symbol.iterator]() {
|
|
@@ -560,9 +550,7 @@ const _UnicodeStringArray = class _UnicodeStringArray {
|
|
|
560
550
|
yield this.get(i);
|
|
561
551
|
}
|
|
562
552
|
}
|
|
563
|
-
}
|
|
564
|
-
_data = new WeakMap();
|
|
565
|
-
let UnicodeStringArray = _UnicodeStringArray;
|
|
553
|
+
}
|
|
566
554
|
function json_decode_object(bytes) {
|
|
567
555
|
const str = new TextDecoder().decode(bytes);
|
|
568
556
|
return JSON.parse(str);
|
|
@@ -621,11 +609,11 @@ function get_strides(shape, order) {
|
|
|
621
609
|
}
|
|
622
610
|
function create_chunk_key_encoder({ name, configuration }) {
|
|
623
611
|
if (name === "default") {
|
|
624
|
-
const separator =
|
|
612
|
+
const separator = configuration?.separator ?? "/";
|
|
625
613
|
return (chunk_coords) => ["c", ...chunk_coords].join(separator);
|
|
626
614
|
}
|
|
627
615
|
if (name === "v2") {
|
|
628
|
-
const separator =
|
|
616
|
+
const separator = configuration?.separator ?? ".";
|
|
629
617
|
return (chunk_coords) => chunk_coords.join(separator) || "0";
|
|
630
618
|
}
|
|
631
619
|
throw new Error(`Unknown chunk key encoding: ${name}`);
|
|
@@ -721,7 +709,7 @@ function is_dtype(dtype, query) {
|
|
|
721
709
|
return !is_string && !is_bigint && !is_boolean && !is_object;
|
|
722
710
|
}
|
|
723
711
|
function is_sharding_codec(codec) {
|
|
724
|
-
return
|
|
712
|
+
return codec?.name === "sharding_indexed";
|
|
725
713
|
}
|
|
726
714
|
function ensure_correct_scalar(metadata) {
|
|
727
715
|
if ((metadata.data_type === "uint64" || metadata.data_type === "int64") && metadata.fill_value != null) {
|
|
@@ -747,7 +735,7 @@ async function decompress(data, { format, signal }) {
|
|
|
747
735
|
const buffer = await decompressedResponse.arrayBuffer();
|
|
748
736
|
return buffer;
|
|
749
737
|
} catch {
|
|
750
|
-
signal
|
|
738
|
+
signal?.throwIfAborted();
|
|
751
739
|
throw new Error(`Failed to decode ${format}`);
|
|
752
740
|
}
|
|
753
741
|
}
|
|
@@ -787,48 +775,42 @@ function bytes_per_element(TypedArray) {
|
|
|
787
775
|
}
|
|
788
776
|
return 4;
|
|
789
777
|
}
|
|
790
|
-
|
|
778
|
+
class BytesCodec {
|
|
791
779
|
constructor(configuration, meta) {
|
|
792
|
-
__privateAdd(this, _stride);
|
|
793
|
-
__privateAdd(this, _TypedArray);
|
|
794
|
-
__privateAdd(this, _BYTES_PER_ELEMENT);
|
|
795
|
-
__privateAdd(this, _shape);
|
|
796
|
-
__privateAdd(this, _endian);
|
|
797
780
|
this.kind = "array_to_bytes";
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
const sample = new
|
|
803
|
-
|
|
804
|
-
}
|
|
781
|
+
this.#endian = configuration?.endian;
|
|
782
|
+
this.#TypedArray = get_ctr(meta.data_type);
|
|
783
|
+
this.#shape = meta.shape;
|
|
784
|
+
this.#stride = get_strides(meta.shape, "C");
|
|
785
|
+
const sample = new this.#TypedArray(0);
|
|
786
|
+
this.#BYTES_PER_ELEMENT = sample.BYTES_PER_ELEMENT;
|
|
787
|
+
}
|
|
788
|
+
#stride;
|
|
789
|
+
#TypedArray;
|
|
790
|
+
#BYTES_PER_ELEMENT;
|
|
791
|
+
#shape;
|
|
792
|
+
#endian;
|
|
805
793
|
static fromConfig(configuration, meta) {
|
|
806
|
-
return new
|
|
794
|
+
return new BytesCodec(configuration, meta);
|
|
807
795
|
}
|
|
808
796
|
encode(arr) {
|
|
809
797
|
let bytes = new Uint8Array(arr.data.buffer);
|
|
810
|
-
if (LITTLE_ENDIAN_OS &&
|
|
811
|
-
byteswap_inplace(bytes, bytes_per_element(
|
|
798
|
+
if (LITTLE_ENDIAN_OS && this.#endian === "big") {
|
|
799
|
+
byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
|
|
812
800
|
}
|
|
813
801
|
return bytes;
|
|
814
802
|
}
|
|
815
803
|
decode(bytes) {
|
|
816
|
-
if (LITTLE_ENDIAN_OS &&
|
|
817
|
-
byteswap_inplace(bytes, bytes_per_element(
|
|
804
|
+
if (LITTLE_ENDIAN_OS && this.#endian === "big") {
|
|
805
|
+
byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
|
|
818
806
|
}
|
|
819
807
|
return {
|
|
820
|
-
data: new
|
|
821
|
-
shape:
|
|
822
|
-
stride:
|
|
808
|
+
data: new this.#TypedArray(bytes.buffer, bytes.byteOffset, bytes.byteLength / this.#BYTES_PER_ELEMENT),
|
|
809
|
+
shape: this.#shape,
|
|
810
|
+
stride: this.#stride
|
|
823
811
|
};
|
|
824
812
|
}
|
|
825
|
-
}
|
|
826
|
-
_stride = new WeakMap();
|
|
827
|
-
_TypedArray = new WeakMap();
|
|
828
|
-
_BYTES_PER_ELEMENT = new WeakMap();
|
|
829
|
-
_shape = new WeakMap();
|
|
830
|
-
_endian = new WeakMap();
|
|
831
|
-
let BytesCodec = _BytesCodec;
|
|
813
|
+
}
|
|
832
814
|
class Crc32cCodec {
|
|
833
815
|
constructor() {
|
|
834
816
|
this.kind = "bytes_to_bytes";
|
|
@@ -850,7 +832,7 @@ class GzipCodec {
|
|
|
850
832
|
static fromConfig(_) {
|
|
851
833
|
return new GzipCodec();
|
|
852
834
|
}
|
|
853
|
-
encode(
|
|
835
|
+
encode(_bytes) {
|
|
854
836
|
throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
|
|
855
837
|
}
|
|
856
838
|
async decode(bytes) {
|
|
@@ -870,10 +852,8 @@ function sort_keys_replacer(_key, value) {
|
|
|
870
852
|
return sorted;
|
|
871
853
|
}, {}) : value;
|
|
872
854
|
}
|
|
873
|
-
|
|
855
|
+
class JsonCodec {
|
|
874
856
|
constructor(configuration = {}) {
|
|
875
|
-
__privateAdd(this, _encoder_config);
|
|
876
|
-
__privateAdd(this, _decoder_config);
|
|
877
857
|
this.kind = "array_to_bytes";
|
|
878
858
|
this.configuration = configuration;
|
|
879
859
|
const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
|
|
@@ -885,7 +865,7 @@ const _JsonCodec = class _JsonCodec {
|
|
|
885
865
|
separators = [", ", ": "];
|
|
886
866
|
}
|
|
887
867
|
}
|
|
888
|
-
|
|
868
|
+
this.#encoder_config = {
|
|
889
869
|
encoding,
|
|
890
870
|
skipkeys,
|
|
891
871
|
ensure_ascii,
|
|
@@ -894,14 +874,16 @@ const _JsonCodec = class _JsonCodec {
|
|
|
894
874
|
indent,
|
|
895
875
|
separators,
|
|
896
876
|
sort_keys
|
|
897
|
-
}
|
|
898
|
-
|
|
877
|
+
};
|
|
878
|
+
this.#decoder_config = { strict };
|
|
899
879
|
}
|
|
880
|
+
#encoder_config;
|
|
881
|
+
#decoder_config;
|
|
900
882
|
static fromConfig(configuration) {
|
|
901
|
-
return new
|
|
883
|
+
return new JsonCodec(configuration);
|
|
902
884
|
}
|
|
903
885
|
encode(buf) {
|
|
904
|
-
const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } =
|
|
886
|
+
const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = this.#encoder_config;
|
|
905
887
|
assert(encoding === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
|
|
906
888
|
const replacer_functions = [];
|
|
907
889
|
assert(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
|
|
@@ -935,7 +917,7 @@ const _JsonCodec = class _JsonCodec {
|
|
|
935
917
|
return new TextEncoder().encode(json_str);
|
|
936
918
|
}
|
|
937
919
|
decode(bytes) {
|
|
938
|
-
const { strict } =
|
|
920
|
+
const { strict } = this.#decoder_config;
|
|
939
921
|
assert(strict, "JsonCodec does not yet support non-strict decoding.");
|
|
940
922
|
const items = json_decode_object(bytes);
|
|
941
923
|
const shape = items.pop();
|
|
@@ -945,10 +927,7 @@ const _JsonCodec = class _JsonCodec {
|
|
|
945
927
|
const data = items;
|
|
946
928
|
return { data, shape, stride };
|
|
947
929
|
}
|
|
948
|
-
}
|
|
949
|
-
_encoder_config = new WeakMap();
|
|
950
|
-
_decoder_config = new WeakMap();
|
|
951
|
-
let JsonCodec = _JsonCodec;
|
|
930
|
+
}
|
|
952
931
|
function proxy(arr) {
|
|
953
932
|
if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
|
|
954
933
|
const arrp = new Proxy(arr, {
|
|
@@ -1017,10 +996,8 @@ function matches_order(chunk, target) {
|
|
|
1017
996
|
assert(source.length === target.length, "Orders must match");
|
|
1018
997
|
return source.every((dim, i) => dim === target[i]);
|
|
1019
998
|
}
|
|
1020
|
-
|
|
999
|
+
class TransposeCodec {
|
|
1021
1000
|
constructor(configuration, meta) {
|
|
1022
|
-
__privateAdd(this, _order);
|
|
1023
|
-
__privateAdd(this, _inverseOrder);
|
|
1024
1001
|
this.kind = "array_to_array";
|
|
1025
1002
|
let value = configuration.order ?? "C";
|
|
1026
1003
|
let rank = meta.shape.length;
|
|
@@ -1043,39 +1020,38 @@ const _TransposeCodec = class _TransposeCodec {
|
|
|
1043
1020
|
inverseOrder[x] = i;
|
|
1044
1021
|
});
|
|
1045
1022
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1023
|
+
this.#order = order;
|
|
1024
|
+
this.#inverseOrder = inverseOrder;
|
|
1048
1025
|
}
|
|
1026
|
+
#order;
|
|
1027
|
+
#inverseOrder;
|
|
1049
1028
|
static fromConfig(configuration, meta) {
|
|
1050
|
-
return new
|
|
1029
|
+
return new TransposeCodec(configuration, meta);
|
|
1051
1030
|
}
|
|
1052
1031
|
encode(arr) {
|
|
1053
|
-
if (matches_order(arr,
|
|
1032
|
+
if (matches_order(arr, this.#inverseOrder)) {
|
|
1054
1033
|
return arr;
|
|
1055
1034
|
}
|
|
1056
|
-
return convert_array_order(arr,
|
|
1035
|
+
return convert_array_order(arr, this.#inverseOrder);
|
|
1057
1036
|
}
|
|
1058
1037
|
decode(arr) {
|
|
1059
1038
|
return {
|
|
1060
1039
|
data: arr.data,
|
|
1061
1040
|
shape: arr.shape,
|
|
1062
|
-
stride: get_strides(arr.shape,
|
|
1041
|
+
stride: get_strides(arr.shape, this.#order)
|
|
1063
1042
|
};
|
|
1064
1043
|
}
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
_inverseOrder = new WeakMap();
|
|
1068
|
-
let TransposeCodec = _TransposeCodec;
|
|
1069
|
-
const _VLenUTF8 = class _VLenUTF8 {
|
|
1044
|
+
}
|
|
1045
|
+
class VLenUTF8 {
|
|
1070
1046
|
constructor(shape) {
|
|
1071
|
-
__privateAdd(this, _shape2);
|
|
1072
|
-
__privateAdd(this, _strides);
|
|
1073
1047
|
this.kind = "array_to_bytes";
|
|
1074
|
-
|
|
1075
|
-
|
|
1048
|
+
this.#shape = shape;
|
|
1049
|
+
this.#strides = get_strides(shape, "C");
|
|
1076
1050
|
}
|
|
1051
|
+
#shape;
|
|
1052
|
+
#strides;
|
|
1077
1053
|
static fromConfig(_, meta) {
|
|
1078
|
-
return new
|
|
1054
|
+
return new VLenUTF8(meta.shape);
|
|
1079
1055
|
}
|
|
1080
1056
|
encode(_chunk) {
|
|
1081
1057
|
throw new Error("Method not implemented.");
|
|
@@ -1091,12 +1067,9 @@ const _VLenUTF8 = class _VLenUTF8 {
|
|
|
1091
1067
|
data[i] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
|
|
1092
1068
|
pos += item_length;
|
|
1093
1069
|
}
|
|
1094
|
-
return { data, shape:
|
|
1070
|
+
return { data, shape: this.#shape, stride: this.#strides };
|
|
1095
1071
|
}
|
|
1096
|
-
}
|
|
1097
|
-
_shape2 = new WeakMap();
|
|
1098
|
-
_strides = new WeakMap();
|
|
1099
|
-
let VLenUTF8 = _VLenUTF8;
|
|
1072
|
+
}
|
|
1100
1073
|
class ZlibCodec {
|
|
1101
1074
|
constructor() {
|
|
1102
1075
|
this.kind = "bytes_to_bytes";
|
|
@@ -1104,7 +1077,7 @@ class ZlibCodec {
|
|
|
1104
1077
|
static fromConfig(_) {
|
|
1105
1078
|
return new ZlibCodec();
|
|
1106
1079
|
}
|
|
1107
|
-
encode(
|
|
1080
|
+
encode(_bytes) {
|
|
1108
1081
|
throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
|
|
1109
1082
|
}
|
|
1110
1083
|
async decode(bytes) {
|
|
@@ -1113,7 +1086,7 @@ class ZlibCodec {
|
|
|
1113
1086
|
}
|
|
1114
1087
|
}
|
|
1115
1088
|
function create_default_registry() {
|
|
1116
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-
|
|
1089
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-DvQQ1ST0.js").then((m) => m.default)).set("lz4", () => import("./lz4-BIbM36RN.js").then((m) => m.default)).set("zstd", () => import("./zstd-CO575QiM.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
|
|
1117
1090
|
}
|
|
1118
1091
|
const registry = create_default_registry();
|
|
1119
1092
|
function create_codec_pipeline(chunk_metadata) {
|
|
@@ -1147,8 +1120,7 @@ function create_codec_pipeline(chunk_metadata) {
|
|
|
1147
1120
|
}
|
|
1148
1121
|
async function load_codecs(chunk_meta) {
|
|
1149
1122
|
let promises = chunk_meta.codecs.map(async (meta) => {
|
|
1150
|
-
|
|
1151
|
-
let Codec = await ((_a3 = registry.get(meta.name)) == null ? void 0 : _a3());
|
|
1123
|
+
let Codec = await registry.get(meta.name)?.();
|
|
1152
1124
|
assert(Codec, `Unknown codec: ${meta.name}`);
|
|
1153
1125
|
return { Codec, meta };
|
|
1154
1126
|
});
|
|
@@ -1247,19 +1219,17 @@ function root$1(store) {
|
|
|
1247
1219
|
class Group extends Location {
|
|
1248
1220
|
constructor(store, path, metadata) {
|
|
1249
1221
|
super(store, path);
|
|
1250
|
-
__privateAdd(this, _metadata);
|
|
1251
1222
|
this.kind = "group";
|
|
1252
|
-
|
|
1223
|
+
this.#metadata = metadata;
|
|
1253
1224
|
}
|
|
1225
|
+
#metadata;
|
|
1254
1226
|
get attrs() {
|
|
1255
|
-
return
|
|
1227
|
+
return this.#metadata.attributes;
|
|
1256
1228
|
}
|
|
1257
1229
|
}
|
|
1258
|
-
_metadata = new WeakMap();
|
|
1259
1230
|
function get_array_order(codecs) {
|
|
1260
|
-
var _a3;
|
|
1261
1231
|
const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
|
|
1262
|
-
return
|
|
1232
|
+
return maybe_transpose_codec?.configuration?.order ?? "C";
|
|
1263
1233
|
}
|
|
1264
1234
|
const CONTEXT_MARKER = Symbol("zarrita.context");
|
|
1265
1235
|
function get_context(obj) {
|
|
@@ -1309,28 +1279,28 @@ function create_context(location, metadata) {
|
|
|
1309
1279
|
}
|
|
1310
1280
|
};
|
|
1311
1281
|
}
|
|
1312
|
-
let Array$1 =
|
|
1282
|
+
let Array$1 = class Array2 extends (_a = Location, _a) {
|
|
1313
1283
|
constructor(store, path, metadata) {
|
|
1314
1284
|
super(store, path);
|
|
1315
|
-
__privateAdd(this, _metadata2);
|
|
1316
1285
|
this.kind = "array";
|
|
1317
|
-
|
|
1286
|
+
this.#metadata = {
|
|
1318
1287
|
...metadata,
|
|
1319
1288
|
fill_value: ensure_correct_scalar(metadata)
|
|
1320
|
-
}
|
|
1289
|
+
};
|
|
1321
1290
|
this[CONTEXT_MARKER] = create_context(this, metadata);
|
|
1322
1291
|
}
|
|
1292
|
+
#metadata;
|
|
1323
1293
|
get attrs() {
|
|
1324
|
-
return
|
|
1294
|
+
return this.#metadata.attributes;
|
|
1325
1295
|
}
|
|
1326
1296
|
get shape() {
|
|
1327
|
-
return
|
|
1297
|
+
return this.#metadata.shape;
|
|
1328
1298
|
}
|
|
1329
1299
|
get chunks() {
|
|
1330
1300
|
return this[CONTEXT_MARKER].chunk_shape;
|
|
1331
1301
|
}
|
|
1332
1302
|
get dtype() {
|
|
1333
|
-
return
|
|
1303
|
+
return this.#metadata.data_type;
|
|
1334
1304
|
}
|
|
1335
1305
|
async getChunk(chunk_coords, options) {
|
|
1336
1306
|
let context = this[CONTEXT_MARKER];
|
|
@@ -1367,7 +1337,7 @@ let Array$1 = (_a2 = class extends (_a = Location, _a) {
|
|
|
1367
1337
|
is(query) {
|
|
1368
1338
|
return is_dtype(this.dtype, query);
|
|
1369
1339
|
}
|
|
1370
|
-
}
|
|
1340
|
+
};
|
|
1371
1341
|
function* range$3(start, stop, step = 1) {
|
|
1372
1342
|
if (stop === void 0) {
|
|
1373
1343
|
stop = start;
|
|
@@ -1581,7 +1551,6 @@ function unwrap(arr, idx) {
|
|
|
1581
1551
|
return "get" in arr ? arr.get(idx) : arr[idx];
|
|
1582
1552
|
}
|
|
1583
1553
|
async function get$1(arr, selection, opts, setter2) {
|
|
1584
|
-
var _a3;
|
|
1585
1554
|
let context = get_context(arr);
|
|
1586
1555
|
let indexer = new BasicIndexer({
|
|
1587
1556
|
selection,
|
|
@@ -1589,7 +1558,7 @@ async function get$1(arr, selection, opts, setter2) {
|
|
|
1589
1558
|
chunk_shape: arr.chunks
|
|
1590
1559
|
});
|
|
1591
1560
|
let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a, b) => a * b, 1)), indexer.shape, context.get_strides(indexer.shape));
|
|
1592
|
-
let queue =
|
|
1561
|
+
let queue = opts.create_queue?.() ?? create_queue();
|
|
1593
1562
|
for (const { chunk_coords, mapping } of indexer) {
|
|
1594
1563
|
queue.add(async () => {
|
|
1595
1564
|
let { data, shape, stride } = await arr.getChunk(chunk_coords, opts.opts);
|
|
@@ -2688,15 +2657,15 @@ class BlobReader2 {
|
|
|
2688
2657
|
}
|
|
2689
2658
|
}
|
|
2690
2659
|
class HTTPRangeReader {
|
|
2660
|
+
#overrides;
|
|
2691
2661
|
constructor(url, opts = {}) {
|
|
2692
|
-
__privateAdd(this, _overrides2);
|
|
2693
2662
|
this.url = url;
|
|
2694
|
-
|
|
2663
|
+
this.#overrides = opts.overrides ?? {};
|
|
2695
2664
|
}
|
|
2696
2665
|
async getLength() {
|
|
2697
2666
|
if (this.length === void 0) {
|
|
2698
2667
|
const req = await fetch(this.url, {
|
|
2699
|
-
...
|
|
2668
|
+
...this.#overrides,
|
|
2700
2669
|
method: "HEAD"
|
|
2701
2670
|
});
|
|
2702
2671
|
assert$1(req.ok, `failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
|
|
@@ -2711,12 +2680,11 @@ class HTTPRangeReader {
|
|
|
2711
2680
|
if (size === 0) {
|
|
2712
2681
|
return new Uint8Array(0);
|
|
2713
2682
|
}
|
|
2714
|
-
const req = await fetch_range(this.url, offset, size,
|
|
2683
|
+
const req = await fetch_range(this.url, offset, size, this.#overrides);
|
|
2715
2684
|
assert$1(req.ok, `failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size}: ${req.statusText}`);
|
|
2716
2685
|
return new Uint8Array(await req.arrayBuffer());
|
|
2717
2686
|
}
|
|
2718
2687
|
}
|
|
2719
|
-
_overrides2 = new WeakMap();
|
|
2720
2688
|
class ZipFileStore {
|
|
2721
2689
|
constructor(reader, opts = {}) {
|
|
2722
2690
|
this.info = unzip(reader).then((info) => {
|
|
@@ -2763,14 +2731,13 @@ function parse$1(template, re2 = /{{(.*?)}}/) {
|
|
|
2763
2731
|
}
|
|
2764
2732
|
function matchFn(str) {
|
|
2765
2733
|
const match = str.match(/(?<fname>[A-Z_][A-Z_1-9]*)\((?<args>[^)]+)\)/i);
|
|
2766
|
-
if (!
|
|
2734
|
+
if (!match?.groups) return;
|
|
2767
2735
|
const { fname, args } = match.groups;
|
|
2768
2736
|
const ctx = Object.fromEntries(
|
|
2769
2737
|
args.split(",").map((kwarg) => {
|
|
2770
|
-
|
|
2771
|
-
const { key, num, str: str2 } = ((_a3 = kwarg.match(
|
|
2738
|
+
const { key, num, str: str2 } = kwarg.match(
|
|
2772
2739
|
/(?<key>[a-z_0-9]*)\s*=\s*((?<num>[0-9.]+)|('|")(?<str>.*)('|"))/i
|
|
2773
|
-
)
|
|
2740
|
+
)?.groups ?? {};
|
|
2774
2741
|
if (!key || !(num || str2)) {
|
|
2775
2742
|
throw Error(`Failed to match fn kwarg: ${kwarg}`);
|
|
2776
2743
|
}
|
|
@@ -2842,7 +2809,6 @@ function parseV0(spec) {
|
|
|
2842
2809
|
return new Map(Object.entries(spec));
|
|
2843
2810
|
}
|
|
2844
2811
|
function parseV1(spec, renderString) {
|
|
2845
|
-
var _a3;
|
|
2846
2812
|
const context = {};
|
|
2847
2813
|
for (const [key, template] of Object.entries(spec.templates ?? {})) {
|
|
2848
2814
|
if (template.includes("{{")) {
|
|
@@ -2859,7 +2825,7 @@ function parseV1(spec, renderString) {
|
|
|
2859
2825
|
if (typeof ref === "string") {
|
|
2860
2826
|
refs.set(key, ref);
|
|
2861
2827
|
} else {
|
|
2862
|
-
const url =
|
|
2828
|
+
const url = ref[0]?.includes("{{") ? render2(ref[0]) : ref[0];
|
|
2863
2829
|
refs.set(key, ref.length === 1 ? [url] : [url, ref[1], ref[2]]);
|
|
2864
2830
|
}
|
|
2865
2831
|
}
|
|
@@ -2958,17 +2924,17 @@ function to_binary(base64) {
|
|
|
2958
2924
|
}
|
|
2959
2925
|
return bytes;
|
|
2960
2926
|
}
|
|
2961
|
-
|
|
2927
|
+
class ReferenceStore {
|
|
2928
|
+
#refs;
|
|
2929
|
+
#opts;
|
|
2930
|
+
#overrides;
|
|
2962
2931
|
constructor(refs, opts = {}) {
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
__privateSet(this, _refs, Promise.resolve(refs));
|
|
2967
|
-
__privateSet(this, _opts, opts);
|
|
2968
|
-
__privateSet(this, _overrides3, opts.overrides || {});
|
|
2932
|
+
this.#refs = Promise.resolve(refs);
|
|
2933
|
+
this.#opts = opts;
|
|
2934
|
+
this.#overrides = opts.overrides || {};
|
|
2969
2935
|
}
|
|
2970
2936
|
async get(key, opts = {}) {
|
|
2971
|
-
let ref = (await
|
|
2937
|
+
let ref = (await this.#refs).get(strip_prefix(key));
|
|
2972
2938
|
if (!ref)
|
|
2973
2939
|
return;
|
|
2974
2940
|
if (typeof ref === "string") {
|
|
@@ -2978,11 +2944,11 @@ const _ReferenceStore = class _ReferenceStore {
|
|
|
2978
2944
|
return new TextEncoder().encode(ref);
|
|
2979
2945
|
}
|
|
2980
2946
|
let [urlOrNull, offset, size] = ref;
|
|
2981
|
-
let url = urlOrNull ??
|
|
2947
|
+
let url = urlOrNull ?? this.#opts.target;
|
|
2982
2948
|
if (!url) {
|
|
2983
2949
|
throw Error(`No url for key ${key}, and no target url provided.`);
|
|
2984
2950
|
}
|
|
2985
|
-
let res = await fetch_range(uri2href(url), offset, size, merge_init(
|
|
2951
|
+
let res = await fetch_range(uri2href(url), offset, size, merge_init(this.#overrides, opts));
|
|
2986
2952
|
if (res.status === 200 || res.status === 206) {
|
|
2987
2953
|
return new Uint8Array(await res.arrayBuffer());
|
|
2988
2954
|
}
|
|
@@ -2990,17 +2956,13 @@ const _ReferenceStore = class _ReferenceStore {
|
|
|
2990
2956
|
}
|
|
2991
2957
|
static fromSpec(spec, opts) {
|
|
2992
2958
|
let refs = Promise.resolve(spec).then((spec2) => parse(spec2));
|
|
2993
|
-
return new
|
|
2959
|
+
return new ReferenceStore(refs, opts);
|
|
2994
2960
|
}
|
|
2995
2961
|
static fromUrl(url, opts) {
|
|
2996
|
-
let spec = fetch(url, opts
|
|
2997
|
-
return
|
|
2962
|
+
let spec = fetch(url, opts?.overrides).then((res) => res.json());
|
|
2963
|
+
return ReferenceStore.fromSpec(spec, opts);
|
|
2998
2964
|
}
|
|
2999
|
-
}
|
|
3000
|
-
_refs = new WeakMap();
|
|
3001
|
-
_opts = new WeakMap();
|
|
3002
|
-
_overrides3 = new WeakMap();
|
|
3003
|
-
let ReferenceStore = _ReferenceStore;
|
|
2965
|
+
}
|
|
3004
2966
|
class RelaxedFetchStore extends FetchStore {
|
|
3005
2967
|
// This allows returning `undefined` for 403 responses,
|
|
3006
2968
|
// as opposed to completely erroring.
|
|
@@ -3009,11 +2971,10 @@ class RelaxedFetchStore extends FetchStore {
|
|
|
3009
2971
|
// custom error handling function or additional options
|
|
3010
2972
|
// to the zarrita FetchStore so that a subclass is not required.
|
|
3011
2973
|
async get(key, options = {}) {
|
|
3012
|
-
var _a3;
|
|
3013
2974
|
try {
|
|
3014
2975
|
return await super.get(key, options);
|
|
3015
2976
|
} catch (e) {
|
|
3016
|
-
if (
|
|
2977
|
+
if (e?.message?.startsWith("Unexpected response status 403") && true) {
|
|
3017
2978
|
return void 0;
|
|
3018
2979
|
}
|
|
3019
2980
|
throw e;
|
|
@@ -3021,7 +2982,7 @@ class RelaxedFetchStore extends FetchStore {
|
|
|
3021
2982
|
}
|
|
3022
2983
|
}
|
|
3023
2984
|
function transformEntriesForZipFileStore(entries) {
|
|
3024
|
-
const topLevelZarrDirectories = new Set(Object.keys(entries).map((k) => k.split("/")[0]).filter((firstPathItem) => firstPathItem
|
|
2985
|
+
const topLevelZarrDirectories = new Set(Object.keys(entries).map((k) => k.split("/")[0]).filter((firstPathItem) => firstPathItem?.endsWith(".zarr")));
|
|
3025
2986
|
if (topLevelZarrDirectories.size === 0) {
|
|
3026
2987
|
return entries;
|
|
3027
2988
|
}
|
|
@@ -3042,11 +3003,11 @@ function zarrOpenRoot(url, fileType, opts) {
|
|
|
3042
3003
|
let store;
|
|
3043
3004
|
if (fileType && fileType.endsWith(".zip")) {
|
|
3044
3005
|
store = ZipFileStore.fromUrl(url, {
|
|
3045
|
-
overrides: opts
|
|
3006
|
+
overrides: opts?.requestInit,
|
|
3046
3007
|
transformEntries: transformEntriesForZipFileStore
|
|
3047
3008
|
});
|
|
3048
3009
|
} else if (fileType && fileType.endsWith(".h5ad")) {
|
|
3049
|
-
if (!
|
|
3010
|
+
if (!opts?.refSpecUrl) {
|
|
3050
3011
|
throw new Error("refSpecUrl is required for H5AD files");
|
|
3051
3012
|
}
|
|
3052
3013
|
const referenceSpecPromise = fetch(opts.refSpecUrl).then((res) => res.json()).then((referenceSpec) => Object.fromEntries(
|
|
@@ -3060,9 +3021,9 @@ function zarrOpenRoot(url, fileType, opts) {
|
|
|
3060
3021
|
return [key, entry];
|
|
3061
3022
|
})
|
|
3062
3023
|
));
|
|
3063
|
-
store = ReferenceStore.fromSpec(referenceSpecPromise, { target: url, overrides: opts
|
|
3024
|
+
store = ReferenceStore.fromSpec(referenceSpecPromise, { target: url, overrides: opts?.requestInit });
|
|
3064
3025
|
} else {
|
|
3065
|
-
store = new RelaxedFetchStore(url, { overrides: opts
|
|
3026
|
+
store = new RelaxedFetchStore(url, { overrides: opts?.requestInit });
|
|
3066
3027
|
}
|
|
3067
3028
|
return root$1(store);
|
|
3068
3029
|
}
|
|
@@ -3321,11 +3282,10 @@ class AnnDataSource extends ZarrDataSource {
|
|
|
3321
3282
|
* @returns {Promise<string[]>} The data from the zarr array.
|
|
3322
3283
|
*/
|
|
3323
3284
|
async getFlatArrDecompressed(path) {
|
|
3324
|
-
var _a3;
|
|
3325
3285
|
const { storeRoot } = this;
|
|
3326
3286
|
const arr = await open(storeRoot.resolve(path), { kind: "array" });
|
|
3327
3287
|
const data = await get(arr);
|
|
3328
|
-
if (
|
|
3288
|
+
if (data.data?.[Symbol.iterator]) {
|
|
3329
3289
|
return (
|
|
3330
3290
|
/** @type {string[]} */
|
|
3331
3291
|
Array.from(data.data)
|
|
@@ -5867,7 +5827,6 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
5867
5827
|
return this.segmentations;
|
|
5868
5828
|
}
|
|
5869
5829
|
async load() {
|
|
5870
|
-
var _a3;
|
|
5871
5830
|
const { path } = this.options;
|
|
5872
5831
|
const channelCoordination = [{
|
|
5873
5832
|
// obsType: null,
|
|
@@ -5890,7 +5849,7 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
5890
5849
|
// spatialTargetT: imageWrapper.getDefaultTargetT(),
|
|
5891
5850
|
segmentationLayer: CL([
|
|
5892
5851
|
{
|
|
5893
|
-
fileUid:
|
|
5852
|
+
fileUid: this.coordinationValues?.fileUid || null,
|
|
5894
5853
|
spatialLayerOpacity: 1,
|
|
5895
5854
|
spatialLayerVisible: true,
|
|
5896
5855
|
segmentationChannel: CL(channelCoordination)
|
|
@@ -6030,7 +5989,7 @@ function toFinite(value) {
|
|
|
6030
5989
|
return value === 0 ? value : 0;
|
|
6031
5990
|
}
|
|
6032
5991
|
value = toNumber(value);
|
|
6033
|
-
if (value === INFINITY || value === -
|
|
5992
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
6034
5993
|
var sign = value < 0 ? -1 : 1;
|
|
6035
5994
|
return sign * MAX_INTEGER;
|
|
6036
5995
|
}
|
|
@@ -6475,8 +6434,8 @@ Stack.prototype.set = stackSet;
|
|
|
6475
6434
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
6476
6435
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
6477
6436
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
6478
|
-
var
|
|
6479
|
-
|
|
6437
|
+
var Buffer = moduleExports ? root.Buffer : void 0;
|
|
6438
|
+
Buffer ? Buffer.allocUnsafe : void 0;
|
|
6480
6439
|
function cloneBuffer(buffer, isDeep) {
|
|
6481
6440
|
{
|
|
6482
6441
|
return buffer.slice();
|
|
@@ -8206,11 +8165,11 @@ class ZodType {
|
|
|
8206
8165
|
throw result.error;
|
|
8207
8166
|
}
|
|
8208
8167
|
safeParse(data, params) {
|
|
8209
|
-
var
|
|
8168
|
+
var _a2;
|
|
8210
8169
|
const ctx = {
|
|
8211
8170
|
common: {
|
|
8212
8171
|
issues: [],
|
|
8213
|
-
async: (
|
|
8172
|
+
async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
|
|
8214
8173
|
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
|
8215
8174
|
},
|
|
8216
8175
|
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
|
@@ -8552,7 +8511,7 @@ class ZodString extends ZodType {
|
|
|
8552
8511
|
} else if (check.kind === "url") {
|
|
8553
8512
|
try {
|
|
8554
8513
|
new URL(input.data);
|
|
8555
|
-
} catch (
|
|
8514
|
+
} catch (_a2) {
|
|
8556
8515
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
8557
8516
|
addIssueToContext(ctx, {
|
|
8558
8517
|
validation: "url",
|
|
@@ -8674,7 +8633,7 @@ class ZodString extends ZodType {
|
|
|
8674
8633
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
8675
8634
|
}
|
|
8676
8635
|
datetime(options) {
|
|
8677
|
-
var
|
|
8636
|
+
var _a2;
|
|
8678
8637
|
if (typeof options === "string") {
|
|
8679
8638
|
return this._addCheck({
|
|
8680
8639
|
kind: "datetime",
|
|
@@ -8686,7 +8645,7 @@ class ZodString extends ZodType {
|
|
|
8686
8645
|
return this._addCheck({
|
|
8687
8646
|
kind: "datetime",
|
|
8688
8647
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
|
8689
|
-
offset: (
|
|
8648
|
+
offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
|
|
8690
8649
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
|
8691
8650
|
});
|
|
8692
8651
|
}
|
|
@@ -8814,11 +8773,11 @@ class ZodString extends ZodType {
|
|
|
8814
8773
|
}
|
|
8815
8774
|
}
|
|
8816
8775
|
ZodString.create = (params) => {
|
|
8817
|
-
var
|
|
8776
|
+
var _a2;
|
|
8818
8777
|
return new ZodString({
|
|
8819
8778
|
checks: [],
|
|
8820
8779
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
8821
|
-
coerce: (
|
|
8780
|
+
coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
|
|
8822
8781
|
...processCreateParams(params)
|
|
8823
8782
|
});
|
|
8824
8783
|
};
|
|
@@ -9219,11 +9178,11 @@ class ZodBigInt extends ZodType {
|
|
|
9219
9178
|
}
|
|
9220
9179
|
}
|
|
9221
9180
|
ZodBigInt.create = (params) => {
|
|
9222
|
-
var
|
|
9181
|
+
var _a2;
|
|
9223
9182
|
return new ZodBigInt({
|
|
9224
9183
|
checks: [],
|
|
9225
9184
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
9226
|
-
coerce: (
|
|
9185
|
+
coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
|
|
9227
9186
|
...processCreateParams(params)
|
|
9228
9187
|
});
|
|
9229
9188
|
};
|
|
@@ -9728,8 +9687,8 @@ class ZodObject extends ZodType {
|
|
|
9728
9687
|
unknownKeys: "strict",
|
|
9729
9688
|
...message !== void 0 ? {
|
|
9730
9689
|
errorMap: (issue, ctx) => {
|
|
9731
|
-
var
|
|
9732
|
-
const defaultError = (_c = (_b = (
|
|
9690
|
+
var _a2, _b, _c, _d;
|
|
9691
|
+
const defaultError = (_c = (_b = (_a2 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a2, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
|
|
9733
9692
|
if (issue.code === "unrecognized_keys")
|
|
9734
9693
|
return {
|
|
9735
9694
|
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
@@ -11139,10 +11098,10 @@ ZodReadonly.create = (type, params) => {
|
|
|
11139
11098
|
const custom = (check, params = {}, fatal) => {
|
|
11140
11099
|
if (check)
|
|
11141
11100
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
11142
|
-
var
|
|
11101
|
+
var _a2, _b;
|
|
11143
11102
|
if (!check(data)) {
|
|
11144
11103
|
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
11145
|
-
const _fatal = (_b = (
|
|
11104
|
+
const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
|
|
11146
11105
|
const p2 = typeof p === "string" ? { message: p } : p;
|
|
11147
11106
|
ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
|
|
11148
11107
|
}
|
|
@@ -11640,13 +11599,12 @@ function upgradeFrom0_1_0(config2, datasetUid = null) {
|
|
|
11640
11599
|
};
|
|
11641
11600
|
const layout = [];
|
|
11642
11601
|
config2.staticLayout.forEach((componentDef) => {
|
|
11643
|
-
var _a3, _b, _c;
|
|
11644
11602
|
let newComponentDef = {
|
|
11645
11603
|
...componentDef,
|
|
11646
11604
|
coordinationScopes: {}
|
|
11647
11605
|
};
|
|
11648
11606
|
if (componentDef.component === "scatterplot") {
|
|
11649
|
-
if (
|
|
11607
|
+
if (componentDef.props?.mapping && typeof componentDef.props.mapping === "string") {
|
|
11650
11608
|
coordinationSpace.embeddingType[componentDef.props.mapping] = componentDef.props.mapping;
|
|
11651
11609
|
newComponentDef = {
|
|
11652
11610
|
...newComponentDef,
|
|
@@ -11656,7 +11614,7 @@ function upgradeFrom0_1_0(config2, datasetUid = null) {
|
|
|
11656
11614
|
}
|
|
11657
11615
|
};
|
|
11658
11616
|
}
|
|
11659
|
-
if (
|
|
11617
|
+
if (componentDef.props?.view) {
|
|
11660
11618
|
const newScopeValues = upgradeReplaceViewProp("embedding", componentDef.props.view, coordinationSpace);
|
|
11661
11619
|
newComponentDef = {
|
|
11662
11620
|
...newComponentDef,
|
|
@@ -11668,7 +11626,7 @@ function upgradeFrom0_1_0(config2, datasetUid = null) {
|
|
|
11668
11626
|
}
|
|
11669
11627
|
}
|
|
11670
11628
|
if (componentDef.component === "spatial") {
|
|
11671
|
-
if (
|
|
11629
|
+
if (componentDef?.props?.view) {
|
|
11672
11630
|
const newScopeValues = upgradeReplaceViewProp("spatial", componentDef.props.view, coordinationSpace);
|
|
11673
11631
|
newComponentDef = {
|
|
11674
11632
|
...newComponentDef,
|
|
@@ -11758,7 +11716,6 @@ function upgradeFrom1_0_0(config2) {
|
|
|
11758
11716
|
};
|
|
11759
11717
|
}
|
|
11760
11718
|
function upgradeFrom1_0_1(config2) {
|
|
11761
|
-
var _a3;
|
|
11762
11719
|
const layout = config2.layout.map((component) => {
|
|
11763
11720
|
const newComponent = { ...component };
|
|
11764
11721
|
if (newComponent.component === "layerController") {
|
|
@@ -11770,9 +11727,8 @@ function upgradeFrom1_0_1(config2) {
|
|
|
11770
11727
|
return newComponent;
|
|
11771
11728
|
});
|
|
11772
11729
|
const newConfig = cloneDeep(config2);
|
|
11773
|
-
Object.keys(
|
|
11774
|
-
|
|
11775
|
-
if ((_b = (_a4 = newConfig.coordinationSpace) == null ? void 0 : _a4.spatialRasterLayers) == null ? void 0 : _b[key]) {
|
|
11730
|
+
Object.keys(newConfig?.coordinationSpace?.spatialRasterLayers || {}).forEach((key) => {
|
|
11731
|
+
if (newConfig.coordinationSpace?.spatialRasterLayers?.[key]) {
|
|
11776
11732
|
newConfig.coordinationSpace.spatialRasterLayers[key].forEach((layer, index) => {
|
|
11777
11733
|
if (newConfig.coordinationSpace) {
|
|
11778
11734
|
newConfig.coordinationSpace.spatialRasterLayers[key][index].type = ["bitmask", "raster"].includes(layer.type) ? layer.type : "raster";
|
|
@@ -11913,7 +11869,7 @@ function upgradeFrom1_0_10(config2) {
|
|
|
11913
11869
|
function upgradeFrom1_0_11(config2) {
|
|
11914
11870
|
const newConfig = cloneDeep(config2);
|
|
11915
11871
|
const { datasets, coordinationSpace } = newConfig;
|
|
11916
|
-
if (coordinationSpace
|
|
11872
|
+
if (coordinationSpace?.embeddingType) {
|
|
11917
11873
|
const embeddingTypes = Object.values(coordinationSpace.embeddingType);
|
|
11918
11874
|
datasets.forEach((dataset, i) => {
|
|
11919
11875
|
const { files } = dataset;
|
|
@@ -11946,7 +11902,7 @@ function upgradeFrom1_0_12(config2) {
|
|
|
11946
11902
|
if (options && "factors" in options && Array.isArray(options.factors)) {
|
|
11947
11903
|
const obsLabelsTypeScopes = [];
|
|
11948
11904
|
options.factors.forEach((olt) => {
|
|
11949
|
-
const nextScope = getNextScope(Object.keys(
|
|
11905
|
+
const nextScope = getNextScope(Object.keys(coordinationSpace?.obsLabelsType || {}));
|
|
11950
11906
|
newCoordinationSpace.obsLabelsType = {
|
|
11951
11907
|
...newCoordinationSpace.obsLabelsType,
|
|
11952
11908
|
// Need to remove the obs/ prefix.
|
|
@@ -11960,8 +11916,7 @@ function upgradeFrom1_0_12(config2) {
|
|
|
11960
11916
|
});
|
|
11961
11917
|
});
|
|
11962
11918
|
function getDatasetUidForView(viewDef) {
|
|
11963
|
-
|
|
11964
|
-
if (((_a3 = viewDef.coordinationScopes) == null ? void 0 : _a3.dataset) && typeof ((_b = viewDef.coordinationScopes) == null ? void 0 : _b.dataset) === "string") {
|
|
11919
|
+
if (viewDef.coordinationScopes?.dataset && typeof viewDef.coordinationScopes?.dataset === "string") {
|
|
11965
11920
|
return newCoordinationSpace.dataset[viewDef.coordinationScopes.dataset];
|
|
11966
11921
|
}
|
|
11967
11922
|
if (datasets.length > 0) {
|
|
@@ -12024,8 +11979,7 @@ function upgradeFrom1_0_14(config2) {
|
|
|
12024
11979
|
};
|
|
12025
11980
|
newLayout.forEach((viewDef) => {
|
|
12026
11981
|
Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
|
|
12027
|
-
|
|
12028
|
-
if ((_a3 = viewDef.props) == null ? void 0 : _a3[oldProp]) {
|
|
11982
|
+
if (viewDef.props?.[oldProp]) {
|
|
12029
11983
|
log.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
|
|
12030
11984
|
}
|
|
12031
11985
|
});
|
|
@@ -12042,7 +11996,7 @@ function upgradeFrom1_0_15(config2) {
|
|
|
12042
11996
|
const newLayout = layout.map((view) => {
|
|
12043
11997
|
const { coordinationScopes } = view;
|
|
12044
11998
|
const newCoordinationScopes = {};
|
|
12045
|
-
if (
|
|
11999
|
+
if (coordinationScopes?.dataset && Array.isArray(coordinationScopes.dataset)) {
|
|
12046
12000
|
const coordinationScopesBy = {
|
|
12047
12001
|
dataset: {}
|
|
12048
12002
|
};
|
|
@@ -16218,28 +16172,28 @@ function requireJson2csv_umd() {
|
|
|
16218
16172
|
return toString.call(arr) == "[object Array]";
|
|
16219
16173
|
};
|
|
16220
16174
|
var INSPECT_MAX_BYTES = 50;
|
|
16221
|
-
|
|
16175
|
+
Buffer2.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== void 0 ? global$1.TYPED_ARRAY_SUPPORT : true;
|
|
16222
16176
|
function kMaxLength() {
|
|
16223
|
-
return
|
|
16177
|
+
return Buffer2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
16224
16178
|
}
|
|
16225
16179
|
function createBuffer(that, length) {
|
|
16226
16180
|
if (kMaxLength() < length) {
|
|
16227
16181
|
throw new RangeError("Invalid typed array length");
|
|
16228
16182
|
}
|
|
16229
|
-
if (
|
|
16183
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
16230
16184
|
that = new Uint8Array(length);
|
|
16231
|
-
that.__proto__ =
|
|
16185
|
+
that.__proto__ = Buffer2.prototype;
|
|
16232
16186
|
} else {
|
|
16233
16187
|
if (that === null) {
|
|
16234
|
-
that = new
|
|
16188
|
+
that = new Buffer2(length);
|
|
16235
16189
|
}
|
|
16236
16190
|
that.length = length;
|
|
16237
16191
|
}
|
|
16238
16192
|
return that;
|
|
16239
16193
|
}
|
|
16240
|
-
function
|
|
16241
|
-
if (!
|
|
16242
|
-
return new
|
|
16194
|
+
function Buffer2(arg, encodingOrOffset, length) {
|
|
16195
|
+
if (!Buffer2.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer2)) {
|
|
16196
|
+
return new Buffer2(arg, encodingOrOffset, length);
|
|
16243
16197
|
}
|
|
16244
16198
|
if (typeof arg === "number") {
|
|
16245
16199
|
if (typeof encodingOrOffset === "string") {
|
|
@@ -16251,9 +16205,9 @@ function requireJson2csv_umd() {
|
|
|
16251
16205
|
}
|
|
16252
16206
|
return from(this, arg, encodingOrOffset, length);
|
|
16253
16207
|
}
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
arr.__proto__ =
|
|
16208
|
+
Buffer2.poolSize = 8192;
|
|
16209
|
+
Buffer2._augment = function(arr) {
|
|
16210
|
+
arr.__proto__ = Buffer2.prototype;
|
|
16257
16211
|
return arr;
|
|
16258
16212
|
};
|
|
16259
16213
|
function from(that, value, encodingOrOffset, length) {
|
|
@@ -16268,12 +16222,12 @@ function requireJson2csv_umd() {
|
|
|
16268
16222
|
}
|
|
16269
16223
|
return fromObject(that, value);
|
|
16270
16224
|
}
|
|
16271
|
-
|
|
16225
|
+
Buffer2.from = function(value, encodingOrOffset, length) {
|
|
16272
16226
|
return from(null, value, encodingOrOffset, length);
|
|
16273
16227
|
};
|
|
16274
|
-
if (
|
|
16275
|
-
|
|
16276
|
-
|
|
16228
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
16229
|
+
Buffer2.prototype.__proto__ = Uint8Array.prototype;
|
|
16230
|
+
Buffer2.__proto__ = Uint8Array;
|
|
16277
16231
|
}
|
|
16278
16232
|
function assertSize(size) {
|
|
16279
16233
|
if (typeof size !== "number") {
|
|
@@ -16292,30 +16246,30 @@ function requireJson2csv_umd() {
|
|
|
16292
16246
|
}
|
|
16293
16247
|
return createBuffer(that, size);
|
|
16294
16248
|
}
|
|
16295
|
-
|
|
16249
|
+
Buffer2.alloc = function(size, fill, encoding) {
|
|
16296
16250
|
return alloc(null, size, fill, encoding);
|
|
16297
16251
|
};
|
|
16298
16252
|
function allocUnsafe(that, size) {
|
|
16299
16253
|
assertSize(size);
|
|
16300
16254
|
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
|
|
16301
|
-
if (!
|
|
16255
|
+
if (!Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
16302
16256
|
for (var i = 0; i < size; ++i) {
|
|
16303
16257
|
that[i] = 0;
|
|
16304
16258
|
}
|
|
16305
16259
|
}
|
|
16306
16260
|
return that;
|
|
16307
16261
|
}
|
|
16308
|
-
|
|
16262
|
+
Buffer2.allocUnsafe = function(size) {
|
|
16309
16263
|
return allocUnsafe(null, size);
|
|
16310
16264
|
};
|
|
16311
|
-
|
|
16265
|
+
Buffer2.allocUnsafeSlow = function(size) {
|
|
16312
16266
|
return allocUnsafe(null, size);
|
|
16313
16267
|
};
|
|
16314
16268
|
function fromString(that, string, encoding) {
|
|
16315
16269
|
if (typeof encoding !== "string" || encoding === "") {
|
|
16316
16270
|
encoding = "utf8";
|
|
16317
16271
|
}
|
|
16318
|
-
if (!
|
|
16272
|
+
if (!Buffer2.isEncoding(encoding)) {
|
|
16319
16273
|
throw new TypeError('"encoding" must be a valid string encoding');
|
|
16320
16274
|
}
|
|
16321
16275
|
var length = byteLength(string, encoding) | 0;
|
|
@@ -16349,9 +16303,9 @@ function requireJson2csv_umd() {
|
|
|
16349
16303
|
} else {
|
|
16350
16304
|
array = new Uint8Array(array, byteOffset, length);
|
|
16351
16305
|
}
|
|
16352
|
-
if (
|
|
16306
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
16353
16307
|
that = array;
|
|
16354
|
-
that.__proto__ =
|
|
16308
|
+
that.__proto__ = Buffer2.prototype;
|
|
16355
16309
|
} else {
|
|
16356
16310
|
that = fromArrayLike(that, array);
|
|
16357
16311
|
}
|
|
@@ -16386,11 +16340,11 @@ function requireJson2csv_umd() {
|
|
|
16386
16340
|
}
|
|
16387
16341
|
return length | 0;
|
|
16388
16342
|
}
|
|
16389
|
-
|
|
16343
|
+
Buffer2.isBuffer = isBuffer2;
|
|
16390
16344
|
function internalIsBuffer(b) {
|
|
16391
16345
|
return !!(b != null && b._isBuffer);
|
|
16392
16346
|
}
|
|
16393
|
-
|
|
16347
|
+
Buffer2.compare = function compare(a, b) {
|
|
16394
16348
|
if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
|
|
16395
16349
|
throw new TypeError("Arguments must be Buffers");
|
|
16396
16350
|
}
|
|
@@ -16408,7 +16362,7 @@ function requireJson2csv_umd() {
|
|
|
16408
16362
|
if (y < x) return 1;
|
|
16409
16363
|
return 0;
|
|
16410
16364
|
};
|
|
16411
|
-
|
|
16365
|
+
Buffer2.isEncoding = function isEncoding(encoding) {
|
|
16412
16366
|
switch (String(encoding).toLowerCase()) {
|
|
16413
16367
|
case "hex":
|
|
16414
16368
|
case "utf8":
|
|
@@ -16426,12 +16380,12 @@ function requireJson2csv_umd() {
|
|
|
16426
16380
|
return false;
|
|
16427
16381
|
}
|
|
16428
16382
|
};
|
|
16429
|
-
|
|
16383
|
+
Buffer2.concat = function concat(list, length) {
|
|
16430
16384
|
if (!isArray2(list)) {
|
|
16431
16385
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
16432
16386
|
}
|
|
16433
16387
|
if (list.length === 0) {
|
|
16434
|
-
return
|
|
16388
|
+
return Buffer2.alloc(0);
|
|
16435
16389
|
}
|
|
16436
16390
|
var i;
|
|
16437
16391
|
if (length === void 0) {
|
|
@@ -16440,7 +16394,7 @@ function requireJson2csv_umd() {
|
|
|
16440
16394
|
length += list[i].length;
|
|
16441
16395
|
}
|
|
16442
16396
|
}
|
|
16443
|
-
var buffer =
|
|
16397
|
+
var buffer = Buffer2.allocUnsafe(length);
|
|
16444
16398
|
var pos = 0;
|
|
16445
16399
|
for (i = 0; i < list.length; ++i) {
|
|
16446
16400
|
var buf = list[i];
|
|
@@ -16491,7 +16445,7 @@ function requireJson2csv_umd() {
|
|
|
16491
16445
|
}
|
|
16492
16446
|
}
|
|
16493
16447
|
}
|
|
16494
|
-
|
|
16448
|
+
Buffer2.byteLength = byteLength;
|
|
16495
16449
|
function slowToString(encoding, start, end) {
|
|
16496
16450
|
var loweredCase = false;
|
|
16497
16451
|
if (start === void 0 || start < 0) {
|
|
@@ -16538,13 +16492,13 @@ function requireJson2csv_umd() {
|
|
|
16538
16492
|
}
|
|
16539
16493
|
}
|
|
16540
16494
|
}
|
|
16541
|
-
|
|
16495
|
+
Buffer2.prototype._isBuffer = true;
|
|
16542
16496
|
function swap(b, n, m) {
|
|
16543
16497
|
var i = b[n];
|
|
16544
16498
|
b[n] = b[m];
|
|
16545
16499
|
b[m] = i;
|
|
16546
16500
|
}
|
|
16547
|
-
|
|
16501
|
+
Buffer2.prototype.swap16 = function swap16() {
|
|
16548
16502
|
var len = this.length;
|
|
16549
16503
|
if (len % 2 !== 0) {
|
|
16550
16504
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
@@ -16554,7 +16508,7 @@ function requireJson2csv_umd() {
|
|
|
16554
16508
|
}
|
|
16555
16509
|
return this;
|
|
16556
16510
|
};
|
|
16557
|
-
|
|
16511
|
+
Buffer2.prototype.swap32 = function swap32() {
|
|
16558
16512
|
var len = this.length;
|
|
16559
16513
|
if (len % 4 !== 0) {
|
|
16560
16514
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
@@ -16565,7 +16519,7 @@ function requireJson2csv_umd() {
|
|
|
16565
16519
|
}
|
|
16566
16520
|
return this;
|
|
16567
16521
|
};
|
|
16568
|
-
|
|
16522
|
+
Buffer2.prototype.swap64 = function swap64() {
|
|
16569
16523
|
var len = this.length;
|
|
16570
16524
|
if (len % 8 !== 0) {
|
|
16571
16525
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
@@ -16578,18 +16532,18 @@ function requireJson2csv_umd() {
|
|
|
16578
16532
|
}
|
|
16579
16533
|
return this;
|
|
16580
16534
|
};
|
|
16581
|
-
|
|
16535
|
+
Buffer2.prototype.toString = function toString2() {
|
|
16582
16536
|
var length = this.length | 0;
|
|
16583
16537
|
if (length === 0) return "";
|
|
16584
16538
|
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
16585
16539
|
return slowToString.apply(this, arguments);
|
|
16586
16540
|
};
|
|
16587
|
-
|
|
16541
|
+
Buffer2.prototype.equals = function equals(b) {
|
|
16588
16542
|
if (!internalIsBuffer(b)) throw new TypeError("Argument must be a Buffer");
|
|
16589
16543
|
if (this === b) return true;
|
|
16590
|
-
return
|
|
16544
|
+
return Buffer2.compare(this, b) === 0;
|
|
16591
16545
|
};
|
|
16592
|
-
|
|
16546
|
+
Buffer2.prototype.inspect = function inspect2() {
|
|
16593
16547
|
var str = "";
|
|
16594
16548
|
var max = INSPECT_MAX_BYTES;
|
|
16595
16549
|
if (this.length > 0) {
|
|
@@ -16598,7 +16552,7 @@ function requireJson2csv_umd() {
|
|
|
16598
16552
|
}
|
|
16599
16553
|
return "<Buffer " + str + ">";
|
|
16600
16554
|
};
|
|
16601
|
-
|
|
16555
|
+
Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
|
|
16602
16556
|
if (!internalIsBuffer(target)) {
|
|
16603
16557
|
throw new TypeError("Argument must be a Buffer");
|
|
16604
16558
|
}
|
|
@@ -16670,7 +16624,7 @@ function requireJson2csv_umd() {
|
|
|
16670
16624
|
else return -1;
|
|
16671
16625
|
}
|
|
16672
16626
|
if (typeof val === "string") {
|
|
16673
|
-
val =
|
|
16627
|
+
val = Buffer2.from(val, encoding);
|
|
16674
16628
|
}
|
|
16675
16629
|
if (internalIsBuffer(val)) {
|
|
16676
16630
|
if (val.length === 0) {
|
|
@@ -16679,7 +16633,7 @@ function requireJson2csv_umd() {
|
|
|
16679
16633
|
return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
|
|
16680
16634
|
} else if (typeof val === "number") {
|
|
16681
16635
|
val = val & 255;
|
|
16682
|
-
if (
|
|
16636
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === "function") {
|
|
16683
16637
|
if (dir) {
|
|
16684
16638
|
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
|
|
16685
16639
|
} else {
|
|
@@ -16740,13 +16694,13 @@ function requireJson2csv_umd() {
|
|
|
16740
16694
|
}
|
|
16741
16695
|
return -1;
|
|
16742
16696
|
}
|
|
16743
|
-
|
|
16697
|
+
Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
|
|
16744
16698
|
return this.indexOf(val, byteOffset, encoding) !== -1;
|
|
16745
16699
|
};
|
|
16746
|
-
|
|
16700
|
+
Buffer2.prototype.indexOf = function indexOf2(val, byteOffset, encoding) {
|
|
16747
16701
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
|
|
16748
16702
|
};
|
|
16749
|
-
|
|
16703
|
+
Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
16750
16704
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
16751
16705
|
};
|
|
16752
16706
|
function hexWrite(buf, string, offset, length) {
|
|
@@ -16787,7 +16741,7 @@ function requireJson2csv_umd() {
|
|
|
16787
16741
|
function ucs2Write(buf, string, offset, length) {
|
|
16788
16742
|
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
|
|
16789
16743
|
}
|
|
16790
|
-
|
|
16744
|
+
Buffer2.prototype.write = function write2(string, offset, length, encoding) {
|
|
16791
16745
|
if (offset === void 0) {
|
|
16792
16746
|
encoding = "utf8";
|
|
16793
16747
|
length = this.length;
|
|
@@ -16843,7 +16797,7 @@ function requireJson2csv_umd() {
|
|
|
16843
16797
|
}
|
|
16844
16798
|
}
|
|
16845
16799
|
};
|
|
16846
|
-
|
|
16800
|
+
Buffer2.prototype.toJSON = function toJSON() {
|
|
16847
16801
|
return {
|
|
16848
16802
|
type: "Buffer",
|
|
16849
16803
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
@@ -16966,7 +16920,7 @@ function requireJson2csv_umd() {
|
|
|
16966
16920
|
}
|
|
16967
16921
|
return res;
|
|
16968
16922
|
}
|
|
16969
|
-
|
|
16923
|
+
Buffer2.prototype.slice = function slice2(start, end) {
|
|
16970
16924
|
var len = this.length;
|
|
16971
16925
|
start = ~~start;
|
|
16972
16926
|
end = end === void 0 ? len : ~~end;
|
|
@@ -16984,12 +16938,12 @@ function requireJson2csv_umd() {
|
|
|
16984
16938
|
}
|
|
16985
16939
|
if (end < start) end = start;
|
|
16986
16940
|
var newBuf;
|
|
16987
|
-
if (
|
|
16941
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
16988
16942
|
newBuf = this.subarray(start, end);
|
|
16989
|
-
newBuf.__proto__ =
|
|
16943
|
+
newBuf.__proto__ = Buffer2.prototype;
|
|
16990
16944
|
} else {
|
|
16991
16945
|
var sliceLen = end - start;
|
|
16992
|
-
newBuf = new
|
|
16946
|
+
newBuf = new Buffer2(sliceLen, void 0);
|
|
16993
16947
|
for (var i = 0; i < sliceLen; ++i) {
|
|
16994
16948
|
newBuf[i] = this[i + start];
|
|
16995
16949
|
}
|
|
@@ -17000,7 +16954,7 @@ function requireJson2csv_umd() {
|
|
|
17000
16954
|
if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
|
|
17001
16955
|
if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
|
|
17002
16956
|
}
|
|
17003
|
-
|
|
16957
|
+
Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
|
|
17004
16958
|
offset = offset | 0;
|
|
17005
16959
|
byteLength2 = byteLength2 | 0;
|
|
17006
16960
|
if (!noAssert) checkOffset(offset, byteLength2, this.length);
|
|
@@ -17012,7 +16966,7 @@ function requireJson2csv_umd() {
|
|
|
17012
16966
|
}
|
|
17013
16967
|
return val;
|
|
17014
16968
|
};
|
|
17015
|
-
|
|
16969
|
+
Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
|
|
17016
16970
|
offset = offset | 0;
|
|
17017
16971
|
byteLength2 = byteLength2 | 0;
|
|
17018
16972
|
if (!noAssert) {
|
|
@@ -17025,27 +16979,27 @@ function requireJson2csv_umd() {
|
|
|
17025
16979
|
}
|
|
17026
16980
|
return val;
|
|
17027
16981
|
};
|
|
17028
|
-
|
|
16982
|
+
Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
|
|
17029
16983
|
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
17030
16984
|
return this[offset];
|
|
17031
16985
|
};
|
|
17032
|
-
|
|
16986
|
+
Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
|
|
17033
16987
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
17034
16988
|
return this[offset] | this[offset + 1] << 8;
|
|
17035
16989
|
};
|
|
17036
|
-
|
|
16990
|
+
Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
|
|
17037
16991
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
17038
16992
|
return this[offset] << 8 | this[offset + 1];
|
|
17039
16993
|
};
|
|
17040
|
-
|
|
16994
|
+
Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
|
|
17041
16995
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
17042
16996
|
return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
|
|
17043
16997
|
};
|
|
17044
|
-
|
|
16998
|
+
Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
|
|
17045
16999
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
17046
17000
|
return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
|
|
17047
17001
|
};
|
|
17048
|
-
|
|
17002
|
+
Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
|
|
17049
17003
|
offset = offset | 0;
|
|
17050
17004
|
byteLength2 = byteLength2 | 0;
|
|
17051
17005
|
if (!noAssert) checkOffset(offset, byteLength2, this.length);
|
|
@@ -17059,7 +17013,7 @@ function requireJson2csv_umd() {
|
|
|
17059
17013
|
if (val >= mul) val -= Math.pow(2, 8 * byteLength2);
|
|
17060
17014
|
return val;
|
|
17061
17015
|
};
|
|
17062
|
-
|
|
17016
|
+
Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
|
|
17063
17017
|
offset = offset | 0;
|
|
17064
17018
|
byteLength2 = byteLength2 | 0;
|
|
17065
17019
|
if (!noAssert) checkOffset(offset, byteLength2, this.length);
|
|
@@ -17073,42 +17027,42 @@ function requireJson2csv_umd() {
|
|
|
17073
17027
|
if (val >= mul) val -= Math.pow(2, 8 * byteLength2);
|
|
17074
17028
|
return val;
|
|
17075
17029
|
};
|
|
17076
|
-
|
|
17030
|
+
Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
|
|
17077
17031
|
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
17078
17032
|
if (!(this[offset] & 128)) return this[offset];
|
|
17079
17033
|
return (255 - this[offset] + 1) * -1;
|
|
17080
17034
|
};
|
|
17081
|
-
|
|
17035
|
+
Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
|
|
17082
17036
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
17083
17037
|
var val = this[offset] | this[offset + 1] << 8;
|
|
17084
17038
|
return val & 32768 ? val | 4294901760 : val;
|
|
17085
17039
|
};
|
|
17086
|
-
|
|
17040
|
+
Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
|
|
17087
17041
|
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
17088
17042
|
var val = this[offset + 1] | this[offset] << 8;
|
|
17089
17043
|
return val & 32768 ? val | 4294901760 : val;
|
|
17090
17044
|
};
|
|
17091
|
-
|
|
17045
|
+
Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
|
|
17092
17046
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
17093
17047
|
return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
|
|
17094
17048
|
};
|
|
17095
|
-
|
|
17049
|
+
Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
|
|
17096
17050
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
17097
17051
|
return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
|
|
17098
17052
|
};
|
|
17099
|
-
|
|
17053
|
+
Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
|
|
17100
17054
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
17101
17055
|
return read(this, offset, true, 23, 4);
|
|
17102
17056
|
};
|
|
17103
|
-
|
|
17057
|
+
Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
|
|
17104
17058
|
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
17105
17059
|
return read(this, offset, false, 23, 4);
|
|
17106
17060
|
};
|
|
17107
|
-
|
|
17061
|
+
Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
|
|
17108
17062
|
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
17109
17063
|
return read(this, offset, true, 52, 8);
|
|
17110
17064
|
};
|
|
17111
|
-
|
|
17065
|
+
Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
|
|
17112
17066
|
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
17113
17067
|
return read(this, offset, false, 52, 8);
|
|
17114
17068
|
};
|
|
@@ -17117,7 +17071,7 @@ function requireJson2csv_umd() {
|
|
|
17117
17071
|
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
|
|
17118
17072
|
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
|
17119
17073
|
}
|
|
17120
|
-
|
|
17074
|
+
Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
|
|
17121
17075
|
value = +value;
|
|
17122
17076
|
offset = offset | 0;
|
|
17123
17077
|
byteLength2 = byteLength2 | 0;
|
|
@@ -17133,7 +17087,7 @@ function requireJson2csv_umd() {
|
|
|
17133
17087
|
}
|
|
17134
17088
|
return offset + byteLength2;
|
|
17135
17089
|
};
|
|
17136
|
-
|
|
17090
|
+
Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
|
|
17137
17091
|
value = +value;
|
|
17138
17092
|
offset = offset | 0;
|
|
17139
17093
|
byteLength2 = byteLength2 | 0;
|
|
@@ -17149,11 +17103,11 @@ function requireJson2csv_umd() {
|
|
|
17149
17103
|
}
|
|
17150
17104
|
return offset + byteLength2;
|
|
17151
17105
|
};
|
|
17152
|
-
|
|
17106
|
+
Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
|
|
17153
17107
|
value = +value;
|
|
17154
17108
|
offset = offset | 0;
|
|
17155
17109
|
if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
|
|
17156
|
-
if (!
|
|
17110
|
+
if (!Buffer2.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
|
|
17157
17111
|
this[offset] = value & 255;
|
|
17158
17112
|
return offset + 1;
|
|
17159
17113
|
};
|
|
@@ -17163,11 +17117,11 @@ function requireJson2csv_umd() {
|
|
|
17163
17117
|
buf[offset + i] = (value & 255 << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
|
|
17164
17118
|
}
|
|
17165
17119
|
}
|
|
17166
|
-
|
|
17120
|
+
Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
|
|
17167
17121
|
value = +value;
|
|
17168
17122
|
offset = offset | 0;
|
|
17169
17123
|
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
17170
|
-
if (
|
|
17124
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17171
17125
|
this[offset] = value & 255;
|
|
17172
17126
|
this[offset + 1] = value >>> 8;
|
|
17173
17127
|
} else {
|
|
@@ -17175,11 +17129,11 @@ function requireJson2csv_umd() {
|
|
|
17175
17129
|
}
|
|
17176
17130
|
return offset + 2;
|
|
17177
17131
|
};
|
|
17178
|
-
|
|
17132
|
+
Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
|
|
17179
17133
|
value = +value;
|
|
17180
17134
|
offset = offset | 0;
|
|
17181
17135
|
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
17182
|
-
if (
|
|
17136
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17183
17137
|
this[offset] = value >>> 8;
|
|
17184
17138
|
this[offset + 1] = value & 255;
|
|
17185
17139
|
} else {
|
|
@@ -17193,11 +17147,11 @@ function requireJson2csv_umd() {
|
|
|
17193
17147
|
buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 255;
|
|
17194
17148
|
}
|
|
17195
17149
|
}
|
|
17196
|
-
|
|
17150
|
+
Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
|
|
17197
17151
|
value = +value;
|
|
17198
17152
|
offset = offset | 0;
|
|
17199
17153
|
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
17200
|
-
if (
|
|
17154
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17201
17155
|
this[offset + 3] = value >>> 24;
|
|
17202
17156
|
this[offset + 2] = value >>> 16;
|
|
17203
17157
|
this[offset + 1] = value >>> 8;
|
|
@@ -17207,11 +17161,11 @@ function requireJson2csv_umd() {
|
|
|
17207
17161
|
}
|
|
17208
17162
|
return offset + 4;
|
|
17209
17163
|
};
|
|
17210
|
-
|
|
17164
|
+
Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
|
|
17211
17165
|
value = +value;
|
|
17212
17166
|
offset = offset | 0;
|
|
17213
17167
|
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
17214
|
-
if (
|
|
17168
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17215
17169
|
this[offset] = value >>> 24;
|
|
17216
17170
|
this[offset + 1] = value >>> 16;
|
|
17217
17171
|
this[offset + 2] = value >>> 8;
|
|
@@ -17221,7 +17175,7 @@ function requireJson2csv_umd() {
|
|
|
17221
17175
|
}
|
|
17222
17176
|
return offset + 4;
|
|
17223
17177
|
};
|
|
17224
|
-
|
|
17178
|
+
Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
|
|
17225
17179
|
value = +value;
|
|
17226
17180
|
offset = offset | 0;
|
|
17227
17181
|
if (!noAssert) {
|
|
@@ -17240,7 +17194,7 @@ function requireJson2csv_umd() {
|
|
|
17240
17194
|
}
|
|
17241
17195
|
return offset + byteLength2;
|
|
17242
17196
|
};
|
|
17243
|
-
|
|
17197
|
+
Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
|
|
17244
17198
|
value = +value;
|
|
17245
17199
|
offset = offset | 0;
|
|
17246
17200
|
if (!noAssert) {
|
|
@@ -17259,20 +17213,20 @@ function requireJson2csv_umd() {
|
|
|
17259
17213
|
}
|
|
17260
17214
|
return offset + byteLength2;
|
|
17261
17215
|
};
|
|
17262
|
-
|
|
17216
|
+
Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
|
|
17263
17217
|
value = +value;
|
|
17264
17218
|
offset = offset | 0;
|
|
17265
17219
|
if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
|
|
17266
|
-
if (!
|
|
17220
|
+
if (!Buffer2.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
|
|
17267
17221
|
if (value < 0) value = 255 + value + 1;
|
|
17268
17222
|
this[offset] = value & 255;
|
|
17269
17223
|
return offset + 1;
|
|
17270
17224
|
};
|
|
17271
|
-
|
|
17225
|
+
Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
|
|
17272
17226
|
value = +value;
|
|
17273
17227
|
offset = offset | 0;
|
|
17274
17228
|
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
17275
|
-
if (
|
|
17229
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17276
17230
|
this[offset] = value & 255;
|
|
17277
17231
|
this[offset + 1] = value >>> 8;
|
|
17278
17232
|
} else {
|
|
@@ -17280,11 +17234,11 @@ function requireJson2csv_umd() {
|
|
|
17280
17234
|
}
|
|
17281
17235
|
return offset + 2;
|
|
17282
17236
|
};
|
|
17283
|
-
|
|
17237
|
+
Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
|
|
17284
17238
|
value = +value;
|
|
17285
17239
|
offset = offset | 0;
|
|
17286
17240
|
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
17287
|
-
if (
|
|
17241
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17288
17242
|
this[offset] = value >>> 8;
|
|
17289
17243
|
this[offset + 1] = value & 255;
|
|
17290
17244
|
} else {
|
|
@@ -17292,11 +17246,11 @@ function requireJson2csv_umd() {
|
|
|
17292
17246
|
}
|
|
17293
17247
|
return offset + 2;
|
|
17294
17248
|
};
|
|
17295
|
-
|
|
17249
|
+
Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
|
|
17296
17250
|
value = +value;
|
|
17297
17251
|
offset = offset | 0;
|
|
17298
17252
|
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
17299
|
-
if (
|
|
17253
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17300
17254
|
this[offset] = value & 255;
|
|
17301
17255
|
this[offset + 1] = value >>> 8;
|
|
17302
17256
|
this[offset + 2] = value >>> 16;
|
|
@@ -17306,12 +17260,12 @@ function requireJson2csv_umd() {
|
|
|
17306
17260
|
}
|
|
17307
17261
|
return offset + 4;
|
|
17308
17262
|
};
|
|
17309
|
-
|
|
17263
|
+
Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
|
|
17310
17264
|
value = +value;
|
|
17311
17265
|
offset = offset | 0;
|
|
17312
17266
|
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
17313
17267
|
if (value < 0) value = 4294967295 + value + 1;
|
|
17314
|
-
if (
|
|
17268
|
+
if (Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17315
17269
|
this[offset] = value >>> 24;
|
|
17316
17270
|
this[offset + 1] = value >>> 16;
|
|
17317
17271
|
this[offset + 2] = value >>> 8;
|
|
@@ -17332,10 +17286,10 @@ function requireJson2csv_umd() {
|
|
|
17332
17286
|
write(buf, value, offset, littleEndian, 23, 4);
|
|
17333
17287
|
return offset + 4;
|
|
17334
17288
|
}
|
|
17335
|
-
|
|
17289
|
+
Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
|
|
17336
17290
|
return writeFloat(this, value, offset, true, noAssert);
|
|
17337
17291
|
};
|
|
17338
|
-
|
|
17292
|
+
Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
|
|
17339
17293
|
return writeFloat(this, value, offset, false, noAssert);
|
|
17340
17294
|
};
|
|
17341
17295
|
function writeDouble(buf, value, offset, littleEndian, noAssert) {
|
|
@@ -17345,13 +17299,13 @@ function requireJson2csv_umd() {
|
|
|
17345
17299
|
write(buf, value, offset, littleEndian, 52, 8);
|
|
17346
17300
|
return offset + 8;
|
|
17347
17301
|
}
|
|
17348
|
-
|
|
17302
|
+
Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
|
|
17349
17303
|
return writeDouble(this, value, offset, true, noAssert);
|
|
17350
17304
|
};
|
|
17351
|
-
|
|
17305
|
+
Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
|
|
17352
17306
|
return writeDouble(this, value, offset, false, noAssert);
|
|
17353
17307
|
};
|
|
17354
|
-
|
|
17308
|
+
Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
|
|
17355
17309
|
if (!start) start = 0;
|
|
17356
17310
|
if (!end && end !== 0) end = this.length;
|
|
17357
17311
|
if (targetStart >= target.length) targetStart = target.length;
|
|
@@ -17374,7 +17328,7 @@ function requireJson2csv_umd() {
|
|
|
17374
17328
|
for (i = len - 1; i >= 0; --i) {
|
|
17375
17329
|
target[i + targetStart] = this[i + start];
|
|
17376
17330
|
}
|
|
17377
|
-
} else if (len < 1e3 || !
|
|
17331
|
+
} else if (len < 1e3 || !Buffer2.TYPED_ARRAY_SUPPORT) {
|
|
17378
17332
|
for (i = 0; i < len; ++i) {
|
|
17379
17333
|
target[i + targetStart] = this[i + start];
|
|
17380
17334
|
}
|
|
@@ -17387,7 +17341,7 @@ function requireJson2csv_umd() {
|
|
|
17387
17341
|
}
|
|
17388
17342
|
return len;
|
|
17389
17343
|
};
|
|
17390
|
-
|
|
17344
|
+
Buffer2.prototype.fill = function fill(val, start, end, encoding) {
|
|
17391
17345
|
if (typeof val === "string") {
|
|
17392
17346
|
if (typeof start === "string") {
|
|
17393
17347
|
encoding = start;
|
|
@@ -17406,7 +17360,7 @@ function requireJson2csv_umd() {
|
|
|
17406
17360
|
if (encoding !== void 0 && typeof encoding !== "string") {
|
|
17407
17361
|
throw new TypeError("encoding must be a string");
|
|
17408
17362
|
}
|
|
17409
|
-
if (typeof encoding === "string" && !
|
|
17363
|
+
if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
|
|
17410
17364
|
throw new TypeError("Unknown encoding: " + encoding);
|
|
17411
17365
|
}
|
|
17412
17366
|
} else if (typeof val === "number") {
|
|
@@ -17427,7 +17381,7 @@ function requireJson2csv_umd() {
|
|
|
17427
17381
|
this[i] = val;
|
|
17428
17382
|
}
|
|
17429
17383
|
} else {
|
|
17430
|
-
var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new
|
|
17384
|
+
var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer2(val, encoding).toString());
|
|
17431
17385
|
var len = bytes.length;
|
|
17432
17386
|
for (i = 0; i < end - start; ++i) {
|
|
17433
17387
|
this[i + start] = bytes[i % len];
|
|
@@ -18107,9 +18061,9 @@ function requireJson2csv_umd() {
|
|
|
18107
18061
|
return ret;
|
|
18108
18062
|
};
|
|
18109
18063
|
BufferList.prototype.concat = function(n) {
|
|
18110
|
-
if (this.length === 0) return
|
|
18064
|
+
if (this.length === 0) return Buffer2.alloc(0);
|
|
18111
18065
|
if (this.length === 1) return this.head.data;
|
|
18112
|
-
var ret =
|
|
18066
|
+
var ret = Buffer2.allocUnsafe(n >>> 0);
|
|
18113
18067
|
var p = this.head;
|
|
18114
18068
|
var i = 0;
|
|
18115
18069
|
while (p) {
|
|
@@ -18119,7 +18073,7 @@ function requireJson2csv_umd() {
|
|
|
18119
18073
|
}
|
|
18120
18074
|
return ret;
|
|
18121
18075
|
};
|
|
18122
|
-
var isBufferEncoding =
|
|
18076
|
+
var isBufferEncoding = Buffer2.isEncoding || function(encoding) {
|
|
18123
18077
|
switch (encoding && encoding.toLowerCase()) {
|
|
18124
18078
|
case "hex":
|
|
18125
18079
|
case "utf8":
|
|
@@ -18162,7 +18116,7 @@ function requireJson2csv_umd() {
|
|
|
18162
18116
|
this.write = passThroughWrite;
|
|
18163
18117
|
return;
|
|
18164
18118
|
}
|
|
18165
|
-
this.charBuffer = new
|
|
18119
|
+
this.charBuffer = new Buffer2(6);
|
|
18166
18120
|
this.charReceived = 0;
|
|
18167
18121
|
this.charLength = 0;
|
|
18168
18122
|
}
|
|
@@ -18312,7 +18266,7 @@ function requireJson2csv_umd() {
|
|
|
18312
18266
|
if (!state.objectMode && typeof chunk === "string") {
|
|
18313
18267
|
encoding = encoding || state.defaultEncoding;
|
|
18314
18268
|
if (encoding !== state.encoding) {
|
|
18315
|
-
chunk =
|
|
18269
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
18316
18270
|
encoding = "";
|
|
18317
18271
|
}
|
|
18318
18272
|
}
|
|
@@ -18804,7 +18758,7 @@ function requireJson2csv_umd() {
|
|
|
18804
18758
|
return ret;
|
|
18805
18759
|
}
|
|
18806
18760
|
function copyFromBuffer(n, list) {
|
|
18807
|
-
var ret =
|
|
18761
|
+
var ret = Buffer2.allocUnsafe(n);
|
|
18808
18762
|
var p = list.head;
|
|
18809
18763
|
var c = 1;
|
|
18810
18764
|
p.data.copy(ret);
|
|
@@ -18936,7 +18890,7 @@ function requireJson2csv_umd() {
|
|
|
18936
18890
|
var er = false;
|
|
18937
18891
|
if (chunk === null) {
|
|
18938
18892
|
er = new TypeError("May not write null values to stream");
|
|
18939
|
-
} else if (!
|
|
18893
|
+
} else if (!Buffer2.isBuffer(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
|
|
18940
18894
|
er = new TypeError("Invalid non-string/buffer chunk");
|
|
18941
18895
|
}
|
|
18942
18896
|
if (er) {
|
|
@@ -18953,7 +18907,7 @@ function requireJson2csv_umd() {
|
|
|
18953
18907
|
cb = encoding;
|
|
18954
18908
|
encoding = null;
|
|
18955
18909
|
}
|
|
18956
|
-
if (
|
|
18910
|
+
if (Buffer2.isBuffer(chunk)) encoding = "buffer";
|
|
18957
18911
|
else if (!encoding) encoding = state.defaultEncoding;
|
|
18958
18912
|
if (typeof cb !== "function") cb = nop;
|
|
18959
18913
|
if (state.ended) writeAfterEnd(this, cb);
|
|
@@ -18982,13 +18936,13 @@ function requireJson2csv_umd() {
|
|
|
18982
18936
|
};
|
|
18983
18937
|
function decodeChunk(state, chunk, encoding) {
|
|
18984
18938
|
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
18985
|
-
chunk =
|
|
18939
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
18986
18940
|
}
|
|
18987
18941
|
return chunk;
|
|
18988
18942
|
}
|
|
18989
18943
|
function writeOrBuffer(stream, state, chunk, encoding, cb) {
|
|
18990
18944
|
chunk = decodeChunk(state, chunk, encoding);
|
|
18991
|
-
if (
|
|
18945
|
+
if (Buffer2.isBuffer(chunk)) encoding = "buffer";
|
|
18992
18946
|
var len = state.objectMode ? 1 : chunk.length;
|
|
18993
18947
|
state.length += len;
|
|
18994
18948
|
var ret = state.length < state.highWaterMark;
|
|
@@ -20111,7 +20065,7 @@ function requireJson2csv_umd() {
|
|
|
20111
20065
|
this.tState = START;
|
|
20112
20066
|
this.value = void 0;
|
|
20113
20067
|
this.string = void 0;
|
|
20114
|
-
this.stringBuffer =
|
|
20068
|
+
this.stringBuffer = Buffer2.alloc ? Buffer2.alloc(STRING_BUFFER_SIZE) : new Buffer2(STRING_BUFFER_SIZE);
|
|
20115
20069
|
this.stringBufferOffset = 0;
|
|
20116
20070
|
this.unicode = void 0;
|
|
20117
20071
|
this.highSurrogate = void 0;
|
|
@@ -20121,7 +20075,7 @@ function requireJson2csv_umd() {
|
|
|
20121
20075
|
this.state = VALUE;
|
|
20122
20076
|
this.bytes_remaining = 0;
|
|
20123
20077
|
this.bytes_in_sequence = 0;
|
|
20124
|
-
this.temp_buffs = { "2": new
|
|
20078
|
+
this.temp_buffs = { "2": new Buffer2(2), "3": new Buffer2(3), "4": new Buffer2(4) };
|
|
20125
20079
|
this.offset = -1;
|
|
20126
20080
|
}
|
|
20127
20081
|
Parser.toknam = function(code) {
|
|
@@ -20173,7 +20127,7 @@ function requireJson2csv_umd() {
|
|
|
20173
20127
|
this.stringBufferOffset += size;
|
|
20174
20128
|
};
|
|
20175
20129
|
proto.write = function(buffer) {
|
|
20176
|
-
if (typeof buffer === "string") buffer = new
|
|
20130
|
+
if (typeof buffer === "string") buffer = new Buffer2(buffer);
|
|
20177
20131
|
var n;
|
|
20178
20132
|
for (var i = 0, l = buffer.length; i < l; i++) {
|
|
20179
20133
|
if (this.tState === START) {
|
|
@@ -20244,7 +20198,7 @@ function requireJson2csv_umd() {
|
|
|
20244
20198
|
this.string += this.stringBuffer.toString("utf8", 0, this.stringBufferOffset);
|
|
20245
20199
|
this.stringBufferOffset = 0;
|
|
20246
20200
|
this.onToken(STRING, this.string);
|
|
20247
|
-
this.offset +=
|
|
20201
|
+
this.offset += Buffer2.byteLength(this.string, "utf8") + 1;
|
|
20248
20202
|
this.string = void 0;
|
|
20249
20203
|
} else if (n === 92) {
|
|
20250
20204
|
this.tState = STRING2;
|
|
@@ -20293,16 +20247,16 @@ function requireJson2csv_umd() {
|
|
|
20293
20247
|
var intVal = parseInt(this.unicode, 16);
|
|
20294
20248
|
this.unicode = void 0;
|
|
20295
20249
|
if (this.highSurrogate !== void 0 && intVal >= 56320 && intVal < 57343 + 1) {
|
|
20296
|
-
this.appendStringBuf(new
|
|
20250
|
+
this.appendStringBuf(new Buffer2(String.fromCharCode(this.highSurrogate, intVal)));
|
|
20297
20251
|
this.highSurrogate = void 0;
|
|
20298
20252
|
} else if (this.highSurrogate === void 0 && intVal >= 55296 && intVal < 56319 + 1) {
|
|
20299
20253
|
this.highSurrogate = intVal;
|
|
20300
20254
|
} else {
|
|
20301
20255
|
if (this.highSurrogate !== void 0) {
|
|
20302
|
-
this.appendStringBuf(new
|
|
20256
|
+
this.appendStringBuf(new Buffer2(String.fromCharCode(this.highSurrogate)));
|
|
20303
20257
|
this.highSurrogate = void 0;
|
|
20304
20258
|
}
|
|
20305
|
-
this.appendStringBuf(new
|
|
20259
|
+
this.appendStringBuf(new Buffer2(String.fromCharCode(intVal)));
|
|
20306
20260
|
}
|
|
20307
20261
|
this.tState = STRING1;
|
|
20308
20262
|
}
|
|
@@ -21050,9 +21004,8 @@ class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21050
21004
|
this.tablePath = null;
|
|
21051
21005
|
}
|
|
21052
21006
|
loadObsIndices() {
|
|
21053
|
-
var _a3;
|
|
21054
21007
|
const { options } = this;
|
|
21055
|
-
const obsIndexPromises =
|
|
21008
|
+
const obsIndexPromises = options.obsSets?.map(({ path }) => path).map((pathOrPaths) => {
|
|
21056
21009
|
if (Array.isArray(pathOrPaths)) {
|
|
21057
21010
|
if (pathOrPaths.length > 0) {
|
|
21058
21011
|
return this.dataSource.loadObsIndex(pathOrPaths[0]);
|
|
@@ -21064,15 +21017,13 @@ class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21064
21017
|
return Promise.all(obsIndexPromises);
|
|
21065
21018
|
}
|
|
21066
21019
|
loadCellSetIds() {
|
|
21067
|
-
var _a3;
|
|
21068
21020
|
const { options } = this;
|
|
21069
|
-
const cellSetZarrLocation =
|
|
21021
|
+
const cellSetZarrLocation = options.obsSets?.map(({ path }) => path);
|
|
21070
21022
|
return this.dataSource.loadObsColumns(cellSetZarrLocation);
|
|
21071
21023
|
}
|
|
21072
21024
|
loadCellSetScores() {
|
|
21073
|
-
var _a3;
|
|
21074
21025
|
const { options } = this;
|
|
21075
|
-
const cellSetScoreZarrLocation =
|
|
21026
|
+
const cellSetScoreZarrLocation = options.obsSets?.map((option) => option.scorePath || void 0);
|
|
21076
21027
|
return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
|
|
21077
21028
|
}
|
|
21078
21029
|
async load() {
|
|
@@ -21162,7 +21113,7 @@ class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21162
21113
|
{
|
|
21163
21114
|
featureIndex,
|
|
21164
21115
|
featureLabels,
|
|
21165
|
-
featureLabelsMap: new Map(featureIndex.map((key, i) => [key, featureLabels
|
|
21116
|
+
featureLabelsMap: new Map(featureIndex.map((key, i) => [key, featureLabels?.[i]]))
|
|
21166
21117
|
},
|
|
21167
21118
|
null
|
|
21168
21119
|
);
|
|
@@ -21174,13 +21125,12 @@ class ObsFeatureColumnsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21174
21125
|
* @returns {Promise} A promise for an array of columns.
|
|
21175
21126
|
*/
|
|
21176
21127
|
async loadObsFeatureColumns() {
|
|
21177
|
-
var _a3;
|
|
21178
21128
|
const { options } = this;
|
|
21179
21129
|
if (this.obsFeatureColumns) {
|
|
21180
21130
|
return this.obsFeatureColumns;
|
|
21181
21131
|
}
|
|
21182
21132
|
if (!this.obsFeatureColumns) {
|
|
21183
|
-
const colPaths =
|
|
21133
|
+
const colPaths = options.obsFeatureColumns?.map(({ path }) => path);
|
|
21184
21134
|
const firstPath = colPaths[0];
|
|
21185
21135
|
const obsIndex = await this.dataSource.loadObsIndex(firstPath);
|
|
21186
21136
|
const featureIndex = colPaths.map((colPath) => basename(colPath));
|
|
@@ -21243,9 +21193,8 @@ class SampleEdgesAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21243
21193
|
}
|
|
21244
21194
|
class SampleSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
21245
21195
|
loadObsIndices() {
|
|
21246
|
-
var _a3;
|
|
21247
21196
|
const { options } = this;
|
|
21248
|
-
const obsIndexPromises =
|
|
21197
|
+
const obsIndexPromises = options.sampleSets?.map(({ path }) => path).map((pathOrPaths) => {
|
|
21249
21198
|
if (Array.isArray(pathOrPaths)) {
|
|
21250
21199
|
if (pathOrPaths.length > 0) {
|
|
21251
21200
|
return this.dataSource.loadDataFrameIndex(pathOrPaths[0]);
|
|
@@ -21257,15 +21206,13 @@ class SampleSetsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21257
21206
|
return Promise.all(obsIndexPromises);
|
|
21258
21207
|
}
|
|
21259
21208
|
loadCellSetIds() {
|
|
21260
|
-
var _a3;
|
|
21261
21209
|
const { options } = this;
|
|
21262
|
-
const cellSetZarrLocation =
|
|
21210
|
+
const cellSetZarrLocation = options.sampleSets?.map(({ path }) => path);
|
|
21263
21211
|
return this.dataSource.loadObsColumns(cellSetZarrLocation);
|
|
21264
21212
|
}
|
|
21265
21213
|
loadCellSetScores() {
|
|
21266
|
-
var _a3;
|
|
21267
21214
|
const { options } = this;
|
|
21268
|
-
const cellSetScoreZarrLocation =
|
|
21215
|
+
const cellSetScoreZarrLocation = options.sampleSets?.map((option) => option.scorePath || void 0);
|
|
21269
21216
|
return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
|
|
21270
21217
|
}
|
|
21271
21218
|
async load() {
|
|
@@ -21550,14 +21497,13 @@ class FeatureStatsAnndataLoader2 extends AbstractTwoStepLoader {
|
|
|
21550
21497
|
Object.values(metadata.comparisons).forEach((comparisonGroupObject) => {
|
|
21551
21498
|
const { results } = comparisonGroupObject;
|
|
21552
21499
|
results.forEach((resultObject) => {
|
|
21553
|
-
var _a3;
|
|
21554
21500
|
const {
|
|
21555
21501
|
analysis_type,
|
|
21556
21502
|
analysis_params,
|
|
21557
21503
|
coordination_values
|
|
21558
21504
|
// path,
|
|
21559
21505
|
} = resultObject;
|
|
21560
|
-
if (analysis_type === targetAnalysisType &&
|
|
21506
|
+
if (analysis_type === targetAnalysisType && analysis_params?.pertpy_hypergeometric?.enrichr_library_name === targetFeatureSetLibrary) {
|
|
21561
21507
|
if (sampleSetSelection) {
|
|
21562
21508
|
rawObsSetSelection.forEach((obsSetPath) => {
|
|
21563
21509
|
if (isEqual([obsSetPath], coordination_values.obsSetFilter)) {
|
|
@@ -21691,7 +21637,7 @@ class ObsSetStatsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21691
21637
|
const { sampleSetSelection, obsSetSelection } = volcanoOptions || {};
|
|
21692
21638
|
const rawObsSetSelection = obsSetSelection;
|
|
21693
21639
|
const rawSampleSetSelection = sampleSetSelection;
|
|
21694
|
-
if (!sampleSetSelection ||
|
|
21640
|
+
if (!sampleSetSelection || sampleSetSelection?.length !== 2) {
|
|
21695
21641
|
return null;
|
|
21696
21642
|
}
|
|
21697
21643
|
if (!obsSetSelection) {
|
|
@@ -21699,7 +21645,7 @@ class ObsSetStatsAnndataLoader extends AbstractTwoStepLoader {
|
|
|
21699
21645
|
}
|
|
21700
21646
|
const metadata = await this.loadMetadata();
|
|
21701
21647
|
const rawObsSetGroups = Array.from(
|
|
21702
|
-
new Set(rawObsSetSelection.map((setPath) => setPath
|
|
21648
|
+
new Set(rawObsSetSelection.map((setPath) => setPath?.[0]))
|
|
21703
21649
|
);
|
|
21704
21650
|
const matchingComparisons = [];
|
|
21705
21651
|
Object.values(metadata.comparisons).forEach((comparisonGroupObject) => {
|