@loaders.gl/excel 5.0.0-alpha.6 → 5.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +41482 -41283
- package/dist/dist.min.js +45 -45
- package/dist/excel-loader-with-parser.d.ts +6 -2
- package/dist/excel-loader-with-parser.d.ts.map +1 -1
- package/dist/excel-loader.d.ts +14 -7
- package/dist/excel-loader.d.ts.map +1 -1
- package/dist/excel-loader.js +8 -8
- package/dist/excel-loader.js.map +1 -1
- package/dist/excel-worker.js +219 -20
- package/dist/index.cjs +259 -55
- package/dist/index.cjs.map +3 -3
- package/package.json +6 -5
- package/src/excel-loader.ts +10 -7
|
@@ -18,9 +18,11 @@ export declare const ExcelWorkerLoaderWithParser: {
|
|
|
18
18
|
readonly batchType: never;
|
|
19
19
|
readonly version: any;
|
|
20
20
|
readonly worker: true;
|
|
21
|
+
readonly serializeWorkerResult: typeof import("@loaders.gl/arrow/transport").serializeArrowWorkerResult;
|
|
22
|
+
readonly deserializeWorkerResult: typeof import("@loaders.gl/arrow/transport").deserializeArrowWorkerResult;
|
|
21
23
|
readonly options: {
|
|
22
24
|
readonly excel: {
|
|
23
|
-
readonly shape: "
|
|
25
|
+
readonly shape: "arrow-table";
|
|
24
26
|
readonly sheet: undefined;
|
|
25
27
|
};
|
|
26
28
|
};
|
|
@@ -41,9 +43,11 @@ export declare const ExcelLoaderWithParser: {
|
|
|
41
43
|
readonly batchType: never;
|
|
42
44
|
readonly version: any;
|
|
43
45
|
readonly worker: true;
|
|
46
|
+
readonly serializeWorkerResult: typeof import("@loaders.gl/arrow/transport").serializeArrowWorkerResult;
|
|
47
|
+
readonly deserializeWorkerResult: typeof import("@loaders.gl/arrow/transport").deserializeArrowWorkerResult;
|
|
44
48
|
readonly options: {
|
|
45
49
|
readonly excel: {
|
|
46
|
-
readonly shape: "
|
|
50
|
+
readonly shape: "arrow-table";
|
|
47
51
|
readonly sheet: undefined;
|
|
48
52
|
};
|
|
49
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"excel-loader-with-parser.d.ts","sourceRoot":"","sources":["../src/excel-loader-with-parser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAUnE,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,wCAAwC;IACxC,KAAK,CAAC,EAAE;QACN,uDAAuD;QACvD,KAAK,CAAC,EAA4B,AAA1B,yBAAyB,CAAC,kBAAkB,GAAG,aAAa,CAAC;QACrE,mEAAmE;QACnE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,+EAA+E;QAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"excel-loader-with-parser.d.ts","sourceRoot":"","sources":["../src/excel-loader-with-parser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAUnE,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,wCAAwC;IACxC,KAAK,CAAC,EAAE;QACN,uDAAuD;QACvD,KAAK,CAAC,EAA4B,AAA1B,yBAAyB,CAAC,kBAAkB,GAAG,aAAa,CAAC;QACrE,mEAAmE;QACnE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,+EAA+E;QAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;CAE2C,CAAC;AAEpF,8BAA8B;AAC9B,eAAO,MAAM,qBAAqB;kCAGjB,WAAW,YACd,kBAAkB,KAC3B,OAAO,CAAC,cAAc,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;CAWoD,CAAC"}
|
package/dist/excel-loader.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
2
|
import type { ArrowTable, ObjectRowTable } from '@loaders.gl/schema';
|
|
3
|
+
import { deserializeArrowWorkerResult, serializeArrowWorkerResult } from '@loaders.gl/arrow/transport';
|
|
3
4
|
/** Options for parsing Excel worksheets. */
|
|
4
5
|
export type ExcelLoaderOptions = LoaderOptions & {
|
|
5
6
|
/** Options for ExcelLoader */
|
|
@@ -19,9 +20,11 @@ declare function preload(): Promise<{
|
|
|
19
20
|
readonly batchType: never;
|
|
20
21
|
readonly version: any;
|
|
21
22
|
readonly worker: true;
|
|
23
|
+
readonly serializeWorkerResult: typeof serializeArrowWorkerResult;
|
|
24
|
+
readonly deserializeWorkerResult: typeof deserializeArrowWorkerResult;
|
|
22
25
|
readonly options: {
|
|
23
26
|
readonly excel: {
|
|
24
|
-
readonly shape: "
|
|
27
|
+
readonly shape: "arrow-table";
|
|
25
28
|
readonly sheet: undefined;
|
|
26
29
|
};
|
|
27
30
|
};
|
|
@@ -36,14 +39,16 @@ declare function preload(): Promise<{
|
|
|
36
39
|
readonly binary: true;
|
|
37
40
|
}>;
|
|
38
41
|
/** Metadata-only worker loader for Excel files. */
|
|
39
|
-
export declare const
|
|
42
|
+
export declare const ExcelLoader: {
|
|
40
43
|
readonly dataType: ObjectRowTable | ArrowTable;
|
|
41
44
|
readonly batchType: never;
|
|
42
45
|
readonly version: any;
|
|
43
46
|
readonly worker: true;
|
|
47
|
+
readonly serializeWorkerResult: typeof serializeArrowWorkerResult;
|
|
48
|
+
readonly deserializeWorkerResult: typeof deserializeArrowWorkerResult;
|
|
44
49
|
readonly options: {
|
|
45
50
|
readonly excel: {
|
|
46
|
-
readonly shape: "
|
|
51
|
+
readonly shape: "arrow-table";
|
|
47
52
|
readonly sheet: undefined;
|
|
48
53
|
};
|
|
49
54
|
};
|
|
@@ -58,19 +63,21 @@ export declare const ExcelWorkerLoader: {
|
|
|
58
63
|
readonly category: "table";
|
|
59
64
|
readonly binary: true;
|
|
60
65
|
};
|
|
61
|
-
/**
|
|
62
|
-
export declare const
|
|
63
|
-
readonly preload: typeof preload;
|
|
66
|
+
/** @deprecated Use ExcelLoader. */
|
|
67
|
+
export declare const ExcelWorkerLoader: {
|
|
64
68
|
readonly dataType: ObjectRowTable | ArrowTable;
|
|
65
69
|
readonly batchType: never;
|
|
66
70
|
readonly version: any;
|
|
67
71
|
readonly worker: true;
|
|
72
|
+
readonly serializeWorkerResult: typeof serializeArrowWorkerResult;
|
|
73
|
+
readonly deserializeWorkerResult: typeof deserializeArrowWorkerResult;
|
|
68
74
|
readonly options: {
|
|
69
75
|
readonly excel: {
|
|
70
|
-
readonly shape: "
|
|
76
|
+
readonly shape: "arrow-table";
|
|
71
77
|
readonly sheet: undefined;
|
|
72
78
|
};
|
|
73
79
|
};
|
|
80
|
+
readonly preload: typeof preload;
|
|
74
81
|
readonly name: "Excel";
|
|
75
82
|
readonly id: "excel";
|
|
76
83
|
readonly module: "excel";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"excel-loader.d.ts","sourceRoot":"","sources":["../src/excel-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAS,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"excel-loader.d.ts","sourceRoot":"","sources":["../src/excel-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAS,aAAa,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAMrC,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,8BAA8B;IAC9B,KAAK,CAAC,EAAE;QACN,uDAAuD;QACvD,KAAK,CAAC,EAA4B,AAA1B,yBAAyB,CAAC,kBAAkB,GAAG,aAAa,CAAC;QACrE,mEAAmE;QACnE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,+EAA+E;QAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,+DAA+D;AAC/D,iBAAe,OAAO;;uBAQS,cAAc,GAAG,UAAU;wBACrC,KAAK;;;;;;;;;;;;;;;;;;;;GANzB;AAED,mDAAmD;AACnD,eAAO,MAAM,WAAW;uBAEO,cAAc,GAAG,UAAU;wBACrC,KAAK;;;;;;;;;;;;;;;;;;;;;CAYyD,CAAC;AAEpF,mCAAmC;AACnC,eAAO,MAAM,iBAAiB;uBAhBC,cAAc,GAAG,UAAU;wBACrC,KAAK;;;;;;;;;;;;;;;;;;;;;CAekB,CAAC"}
|
package/dist/excel-loader.js
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { ExcelFormat } from "./excel-format.js";
|
|
5
|
+
import { deserializeArrowWorkerResult, serializeArrowWorkerResult } from '@loaders.gl/arrow/transport';
|
|
5
6
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
7
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "5.0.0-alpha.
|
|
8
|
+
const VERSION = typeof "5.0.0-alpha.8" !== 'undefined' ? "5.0.0-alpha.8" : 'latest';
|
|
8
9
|
/** Preloads the parser-bearing Excel loader implementation. */
|
|
9
10
|
async function preload() {
|
|
10
11
|
const { ExcelLoaderWithParser } = await import("./excel-loader-with-parser.js");
|
|
11
12
|
return ExcelLoaderWithParser;
|
|
12
13
|
}
|
|
13
14
|
/** Metadata-only worker loader for Excel files. */
|
|
14
|
-
export const
|
|
15
|
+
export const ExcelLoader = {
|
|
15
16
|
...ExcelFormat,
|
|
16
17
|
dataType: null,
|
|
17
18
|
batchType: null,
|
|
18
19
|
version: VERSION,
|
|
19
20
|
worker: true,
|
|
21
|
+
serializeWorkerResult: serializeArrowWorkerResult,
|
|
22
|
+
deserializeWorkerResult: deserializeArrowWorkerResult,
|
|
20
23
|
options: {
|
|
21
24
|
excel: {
|
|
22
|
-
shape: '
|
|
25
|
+
shape: 'arrow-table',
|
|
23
26
|
sheet: undefined // Load default Sheet
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
preload
|
|
27
30
|
};
|
|
28
|
-
/**
|
|
29
|
-
export const
|
|
30
|
-
...ExcelWorkerLoader,
|
|
31
|
-
preload
|
|
32
|
-
};
|
|
31
|
+
/** @deprecated Use ExcelLoader. */
|
|
32
|
+
export const ExcelWorkerLoader = ExcelLoader;
|
|
33
33
|
//# sourceMappingURL=excel-loader.js.map
|
package/dist/excel-loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"excel-loader.js","sourceRoot":"","sources":["../src/excel-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,WAAW,EAAC,0BAAuB;
|
|
1
|
+
{"version":3,"file":"excel-loader.js","sourceRoot":"","sources":["../src/excel-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAC3C,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,6BAA6B,CAAC;AAErC,yDAAyD;AACzD,qDAAqD;AACrD,MAAM,OAAO,GAAG,sBAAkB,KAAK,WAAW,CAAC,CAAC,iBAAa,CAAC,CAAC,QAAQ,CAAC;AAe5E,+DAA+D;AAC/D,KAAK,UAAU,OAAO;IACpB,MAAM,EAAC,qBAAqB,EAAC,GAAG,MAAM,MAAM,iCAA8B,CAAC;IAC3E,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,WAAW;IACd,QAAQ,EAAE,IAA8C;IACxD,SAAS,EAAE,IAAa;IACxB,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,IAAI;IACZ,qBAAqB,EAAE,0BAA0B;IACjD,uBAAuB,EAAE,4BAA4B;IACrD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,KAAK,EAAE,aAAa;YACpB,KAAK,EAAE,SAAS,CAAC,qBAAqB;SACvC;KACF;IACD,OAAO;CAC0E,CAAC;AAEpF,mCAAmC;AACnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC"}
|
package/dist/excel-worker.js
CHANGED
|
@@ -26876,6 +26876,9 @@
|
|
|
26876
26876
|
return { type: "null", nullable: true };
|
|
26877
26877
|
}
|
|
26878
26878
|
function getDataTypeFromTypedArray(array) {
|
|
26879
|
+
if (typeof Float16Array !== "undefined" && array instanceof Float16Array) {
|
|
26880
|
+
return "float16";
|
|
26881
|
+
}
|
|
26879
26882
|
switch (array.constructor) {
|
|
26880
26883
|
case Int8Array:
|
|
26881
26884
|
return "int8";
|
|
@@ -26890,6 +26893,10 @@
|
|
|
26890
26893
|
return "int32";
|
|
26891
26894
|
case Uint32Array:
|
|
26892
26895
|
return "uint32";
|
|
26896
|
+
case BigInt64Array:
|
|
26897
|
+
return "int64";
|
|
26898
|
+
case BigUint64Array:
|
|
26899
|
+
return "uint64";
|
|
26893
26900
|
case Float32Array:
|
|
26894
26901
|
return "float32";
|
|
26895
26902
|
case Float64Array:
|
|
@@ -41852,6 +41859,13 @@ return true;`);
|
|
|
41852
41859
|
if (isArrowViewType(arrowType, "Utf8View")) {
|
|
41853
41860
|
return "utf8-view";
|
|
41854
41861
|
}
|
|
41862
|
+
if (isOptionalArrowType(arrowType, "LargeList")) {
|
|
41863
|
+
const largeListType = arrowType;
|
|
41864
|
+
return {
|
|
41865
|
+
type: "large-list",
|
|
41866
|
+
children: [serializeArrowField(largeListType.valueField)]
|
|
41867
|
+
};
|
|
41868
|
+
}
|
|
41855
41869
|
switch (arrowType.constructor) {
|
|
41856
41870
|
case Null2:
|
|
41857
41871
|
return "null";
|
|
@@ -41990,12 +42004,6 @@ return true;`);
|
|
|
41990
42004
|
type: "list",
|
|
41991
42005
|
children: [serializeArrowField(listField)]
|
|
41992
42006
|
};
|
|
41993
|
-
case LargeList2:
|
|
41994
|
-
const largeListType = arrowType;
|
|
41995
|
-
return {
|
|
41996
|
-
type: "large-list",
|
|
41997
|
-
children: [serializeArrowField(largeListType.valueField)]
|
|
41998
|
-
};
|
|
41999
42007
|
case FixedSizeList2:
|
|
42000
42008
|
const fixedSizeList = arrowType;
|
|
42001
42009
|
return {
|
|
@@ -42048,7 +42056,13 @@ return true;`);
|
|
|
42048
42056
|
}
|
|
42049
42057
|
case "large-list": {
|
|
42050
42058
|
const field = deserializeArrowField(dataType.children[0], options);
|
|
42051
|
-
|
|
42059
|
+
const LargeList3 = getOptionalArrowConstructor("LargeList");
|
|
42060
|
+
if (!LargeList3) {
|
|
42061
|
+
throw new Error(
|
|
42062
|
+
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
42063
|
+
);
|
|
42064
|
+
}
|
|
42065
|
+
return new LargeList3(field);
|
|
42052
42066
|
}
|
|
42053
42067
|
case "fixed-size-list": {
|
|
42054
42068
|
const child = deserializeArrowField(dataType.children[0], options);
|
|
@@ -42144,11 +42158,11 @@ return true;`);
|
|
|
42144
42158
|
throw new Error("array type not supported");
|
|
42145
42159
|
}
|
|
42146
42160
|
}
|
|
42147
|
-
function
|
|
42148
|
-
return Arrow_dom_exports;
|
|
42161
|
+
function getOptionalArrowConstructor(typeName) {
|
|
42162
|
+
return Arrow_dom_exports[typeName];
|
|
42149
42163
|
}
|
|
42150
42164
|
function isArrowViewType(arrowType, viewTypeName) {
|
|
42151
|
-
const constructor =
|
|
42165
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
42152
42166
|
if (constructor && arrowType instanceof constructor) {
|
|
42153
42167
|
return true;
|
|
42154
42168
|
}
|
|
@@ -42156,12 +42170,16 @@ return true;`);
|
|
|
42156
42170
|
const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
|
|
42157
42171
|
return Boolean(guard?.(arrowType));
|
|
42158
42172
|
}
|
|
42173
|
+
function isOptionalArrowType(arrowType, typeName) {
|
|
42174
|
+
const constructor = getOptionalArrowConstructor(typeName);
|
|
42175
|
+
return Boolean(constructor && arrowType instanceof constructor);
|
|
42176
|
+
}
|
|
42159
42177
|
function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
|
|
42160
42178
|
const viewTypeMode = options?.viewTypes || "never";
|
|
42161
42179
|
if (viewTypeMode === "never") {
|
|
42162
42180
|
return fallbackType;
|
|
42163
42181
|
}
|
|
42164
|
-
const constructor =
|
|
42182
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
42165
42183
|
if (constructor) {
|
|
42166
42184
|
return new constructor();
|
|
42167
42185
|
}
|
|
@@ -42173,7 +42191,7 @@ return true;`);
|
|
|
42173
42191
|
return fallbackType;
|
|
42174
42192
|
}
|
|
42175
42193
|
function makeRequiredArrowViewType(viewTypeName) {
|
|
42176
|
-
const constructor =
|
|
42194
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
42177
42195
|
if (!constructor) {
|
|
42178
42196
|
throw new Error(
|
|
42179
42197
|
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
@@ -42557,36 +42575,217 @@ return true;`);
|
|
|
42557
42575
|
}
|
|
42558
42576
|
});
|
|
42559
42577
|
|
|
42578
|
+
// ../arrow/src/lib/utils/split-arrow-buffers.ts
|
|
42579
|
+
function splitArrowBuffers(input, options = {}) {
|
|
42580
|
+
if (isArrowTable2(input)) {
|
|
42581
|
+
return splitArrowTableBuffersInternal(input, options);
|
|
42582
|
+
}
|
|
42583
|
+
if (isArrowRecordBatch2(input)) {
|
|
42584
|
+
return splitArrowRecordBatchBuffers(input, options);
|
|
42585
|
+
}
|
|
42586
|
+
if (isArrowVector2(input)) {
|
|
42587
|
+
return splitArrowVectorBuffers(input, options);
|
|
42588
|
+
}
|
|
42589
|
+
return splitArrowDataBuffers(input, options);
|
|
42590
|
+
}
|
|
42591
|
+
function isArrowTable2(input) {
|
|
42592
|
+
return "batches" in input;
|
|
42593
|
+
}
|
|
42594
|
+
function isArrowRecordBatch2(input) {
|
|
42595
|
+
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
42596
|
+
}
|
|
42597
|
+
function isArrowVector2(input) {
|
|
42598
|
+
return "data" in input && Array.isArray(input.data);
|
|
42599
|
+
}
|
|
42600
|
+
function splitArrowTableBuffersInternal(table, options) {
|
|
42601
|
+
const recordBatches = table.batches.map(
|
|
42602
|
+
(recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
|
|
42603
|
+
);
|
|
42604
|
+
return new Table(table.schema, recordBatches);
|
|
42605
|
+
}
|
|
42606
|
+
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
42607
|
+
return new RecordBatch3(
|
|
42608
|
+
recordBatch.schema,
|
|
42609
|
+
splitArrowDataBuffers(recordBatch.data, options)
|
|
42610
|
+
);
|
|
42611
|
+
}
|
|
42612
|
+
function splitArrowDataBuffers(data, options) {
|
|
42613
|
+
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
42614
|
+
const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
|
|
42615
|
+
const buffers = {
|
|
42616
|
+
[BufferType.OFFSET]: splitArrowBuffer(data.buffers[BufferType.OFFSET], options),
|
|
42617
|
+
[BufferType.DATA]: splitArrowBuffer(data.buffers[BufferType.DATA], options),
|
|
42618
|
+
[BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
|
|
42619
|
+
[BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
|
|
42620
|
+
};
|
|
42621
|
+
return new Data(
|
|
42622
|
+
data.type,
|
|
42623
|
+
data.offset,
|
|
42624
|
+
data.length,
|
|
42625
|
+
// @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
|
|
42626
|
+
data._nullCount,
|
|
42627
|
+
buffers,
|
|
42628
|
+
children,
|
|
42629
|
+
dictionary
|
|
42630
|
+
);
|
|
42631
|
+
}
|
|
42632
|
+
function splitArrowVectorBuffers(vector, options) {
|
|
42633
|
+
return new Vector(vector.data.map((data) => splitArrowDataBuffers(data, options)));
|
|
42634
|
+
}
|
|
42635
|
+
function splitArrowBuffer(array, options) {
|
|
42636
|
+
if (!isArrowTypedArray(array)) {
|
|
42637
|
+
return array;
|
|
42638
|
+
}
|
|
42639
|
+
if (options.copy === "none") {
|
|
42640
|
+
return array;
|
|
42641
|
+
}
|
|
42642
|
+
if (options.copy !== "all" && array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {
|
|
42643
|
+
return array;
|
|
42644
|
+
}
|
|
42645
|
+
return array.slice();
|
|
42646
|
+
}
|
|
42647
|
+
function isArrowTypedArray(value) {
|
|
42648
|
+
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
42649
|
+
}
|
|
42650
|
+
var init_split_arrow_buffers = __esm({
|
|
42651
|
+
"../arrow/src/lib/utils/split-arrow-buffers.ts"() {
|
|
42652
|
+
"use strict";
|
|
42653
|
+
init_Arrow_dom();
|
|
42654
|
+
}
|
|
42655
|
+
});
|
|
42656
|
+
|
|
42657
|
+
// ../arrow/src/lib/utils/arrow-table-transport.ts
|
|
42658
|
+
function dehydrateArrowTable(table, options) {
|
|
42659
|
+
const splitTable = splitArrowBuffers(table, options);
|
|
42660
|
+
return {
|
|
42661
|
+
shape: "arrow-table",
|
|
42662
|
+
transport: "arrow-js",
|
|
42663
|
+
schema: serializeArrowSchema(splitTable.schema),
|
|
42664
|
+
batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
|
|
42665
|
+
};
|
|
42666
|
+
}
|
|
42667
|
+
function hydrateArrowTable(table) {
|
|
42668
|
+
const schema = deserializeArrowSchema(table.schema);
|
|
42669
|
+
const recordBatches = table.batches.map(
|
|
42670
|
+
(recordBatch) => new RecordBatch3(schema, hydrateArrowData(recordBatch.data))
|
|
42671
|
+
);
|
|
42672
|
+
return new Table(schema, recordBatches);
|
|
42673
|
+
}
|
|
42674
|
+
function serializeArrowWorkerResult(result, options) {
|
|
42675
|
+
if (!isArrowTableWrapper(result)) {
|
|
42676
|
+
return result;
|
|
42677
|
+
}
|
|
42678
|
+
const workerOptions = options;
|
|
42679
|
+
const bufferCopyMode = workerOptions?.core?.workerTransferBufferCopy ?? workerOptions?.workerTransferBufferCopy;
|
|
42680
|
+
return {
|
|
42681
|
+
...result,
|
|
42682
|
+
data: dehydrateArrowTable(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
42683
|
+
};
|
|
42684
|
+
}
|
|
42685
|
+
function deserializeArrowWorkerResult(result) {
|
|
42686
|
+
if (!isDehydratedArrowTableWrapper(result)) {
|
|
42687
|
+
return result;
|
|
42688
|
+
}
|
|
42689
|
+
return { ...result, data: hydrateArrowTable(result.data) };
|
|
42690
|
+
}
|
|
42691
|
+
function isArrowTableWrapper(value) {
|
|
42692
|
+
const table = value;
|
|
42693
|
+
return Boolean(
|
|
42694
|
+
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
42695
|
+
);
|
|
42696
|
+
}
|
|
42697
|
+
function isDehydratedArrowTableWrapper(value) {
|
|
42698
|
+
const table = value;
|
|
42699
|
+
return Boolean(
|
|
42700
|
+
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
42701
|
+
);
|
|
42702
|
+
}
|
|
42703
|
+
function dehydrateArrowRecordBatch(recordBatch) {
|
|
42704
|
+
return { data: dehydrateArrowData(recordBatch.data) };
|
|
42705
|
+
}
|
|
42706
|
+
function dehydrateArrowData(data) {
|
|
42707
|
+
return {
|
|
42708
|
+
type: serializeArrowType(data.type),
|
|
42709
|
+
offset: data.offset,
|
|
42710
|
+
length: data.length,
|
|
42711
|
+
// @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
|
|
42712
|
+
nullCount: data._nullCount,
|
|
42713
|
+
buffers: {
|
|
42714
|
+
[BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
|
|
42715
|
+
[BufferType.DATA]: data.buffers[BufferType.DATA],
|
|
42716
|
+
[BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
|
|
42717
|
+
[BufferType.TYPE]: data.buffers[BufferType.TYPE]
|
|
42718
|
+
},
|
|
42719
|
+
children: data.children.map((childData) => dehydrateArrowData(childData)),
|
|
42720
|
+
dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
|
|
42721
|
+
};
|
|
42722
|
+
}
|
|
42723
|
+
function dehydrateArrowVector(vector) {
|
|
42724
|
+
return { data: vector.data.map((data) => dehydrateArrowData(data)) };
|
|
42725
|
+
}
|
|
42726
|
+
function hydrateArrowData(data) {
|
|
42727
|
+
const children = data.children.map((childData) => hydrateArrowData(childData));
|
|
42728
|
+
const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
|
|
42729
|
+
return new Data(
|
|
42730
|
+
deserializeArrowType(data.type),
|
|
42731
|
+
data.offset,
|
|
42732
|
+
data.length,
|
|
42733
|
+
data.nullCount,
|
|
42734
|
+
data.buffers,
|
|
42735
|
+
children,
|
|
42736
|
+
dictionary
|
|
42737
|
+
);
|
|
42738
|
+
}
|
|
42739
|
+
function hydrateArrowVector(vector) {
|
|
42740
|
+
return new Vector(vector.data.map((data) => hydrateArrowData(data)));
|
|
42741
|
+
}
|
|
42742
|
+
var init_arrow_table_transport = __esm({
|
|
42743
|
+
"../arrow/src/lib/utils/arrow-table-transport.ts"() {
|
|
42744
|
+
"use strict";
|
|
42745
|
+
init_Arrow_dom();
|
|
42746
|
+
init_src();
|
|
42747
|
+
init_split_arrow_buffers();
|
|
42748
|
+
}
|
|
42749
|
+
});
|
|
42750
|
+
|
|
42751
|
+
// ../arrow/src/transport.ts
|
|
42752
|
+
var init_transport = __esm({
|
|
42753
|
+
"../arrow/src/transport.ts"() {
|
|
42754
|
+
"use strict";
|
|
42755
|
+
init_arrow_table_transport();
|
|
42756
|
+
}
|
|
42757
|
+
});
|
|
42758
|
+
|
|
42560
42759
|
// src/excel-loader.ts
|
|
42561
42760
|
async function preload() {
|
|
42562
42761
|
const { ExcelLoaderWithParser: ExcelLoaderWithParser2 } = await Promise.resolve().then(() => (init_excel_loader_with_parser(), excel_loader_with_parser_exports));
|
|
42563
42762
|
return ExcelLoaderWithParser2;
|
|
42564
42763
|
}
|
|
42565
|
-
var VERSION,
|
|
42764
|
+
var VERSION, ExcelLoader, ExcelWorkerLoader;
|
|
42566
42765
|
var init_excel_loader = __esm({
|
|
42567
42766
|
"src/excel-loader.ts"() {
|
|
42568
42767
|
"use strict";
|
|
42569
42768
|
init_excel_format();
|
|
42570
|
-
|
|
42571
|
-
|
|
42769
|
+
init_transport();
|
|
42770
|
+
VERSION = true ? "5.0.0-alpha.8" : "latest";
|
|
42771
|
+
ExcelLoader = {
|
|
42572
42772
|
...ExcelFormat,
|
|
42573
42773
|
dataType: null,
|
|
42574
42774
|
batchType: null,
|
|
42575
42775
|
version: VERSION,
|
|
42576
42776
|
worker: true,
|
|
42777
|
+
serializeWorkerResult: serializeArrowWorkerResult,
|
|
42778
|
+
deserializeWorkerResult: deserializeArrowWorkerResult,
|
|
42577
42779
|
options: {
|
|
42578
42780
|
excel: {
|
|
42579
|
-
shape: "
|
|
42781
|
+
shape: "arrow-table",
|
|
42580
42782
|
sheet: void 0
|
|
42581
42783
|
// Load default Sheet
|
|
42582
42784
|
}
|
|
42583
42785
|
},
|
|
42584
42786
|
preload
|
|
42585
42787
|
};
|
|
42586
|
-
|
|
42587
|
-
...ExcelWorkerLoader,
|
|
42588
|
-
preload
|
|
42589
|
-
};
|
|
42788
|
+
ExcelWorkerLoader = ExcelLoader;
|
|
42590
42789
|
}
|
|
42591
42790
|
});
|
|
42592
42791
|
|