javascript-excel 2.0.0-alpha.2 → 2.0.0-alpha.3
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/README.md +151 -21
- package/dist/address-DUn7-5OS.js +75 -0
- package/dist/address-DZBHchLv.cjs +122 -0
- package/dist/{auto-width-2oBzjeNG.d.cts → auto-width-DRHsPKNk.d.cts} +1 -1
- package/dist/cells-CPXU722t.cjs +33 -0
- package/dist/cells-CrMF8h_t.js +28 -0
- package/dist/colors-B8Nf_xTx.js +114 -0
- package/dist/colors-oBpjx97l.cjs +119 -0
- package/dist/csv.d.cts +4 -1
- package/dist/csv.d.ts +4 -1
- package/dist/dataset-KeMzHCGl.js +664 -0
- package/dist/dataset-UUZCzsi3.cjs +687 -0
- package/dist/dates-BXcSWf9_.js +64 -0
- package/dist/dates-CA1dCizp.cjs +75 -0
- package/dist/dom.cjs +5 -2
- package/dist/dom.d.cts +5 -2
- package/dist/dom.d.ts +4 -1
- package/dist/dom.js +4 -1
- package/dist/{numfmt-Dv6AjopS.cjs → dos-time-FZ7-1tot.cjs} +0 -199
- package/dist/{numfmt-BBgB7iQA.js → dos-time-dD0z1YWU.js} +2 -177
- package/dist/format.cjs +1264 -0
- package/dist/format.d.cts +59 -0
- package/dist/format.d.ts +59 -0
- package/dist/format.js +1262 -0
- package/dist/import.cjs +10 -0
- package/dist/import.d.cts +10 -0
- package/dist/import.d.ts +10 -0
- package/dist/import.js +1 -0
- package/dist/index.cjs +24 -607
- package/dist/index.d.cts +32 -6
- package/dist/index.d.ts +31 -5
- package/dist/index.js +10 -594
- package/dist/{warnings-C_12PT4t.d.cts → model-0JikLfuM.d.cts} +1 -41
- package/dist/{warnings-DXJKe1lx.d.ts → model-0JikLfuM.d.ts} +1 -41
- package/dist/numfmt-BmEbm78Y.cjs +125 -0
- package/dist/numfmt-DCDrX9P1.js +114 -0
- package/dist/pipeline-BAJtzBdW.js +1085 -0
- package/dist/pipeline-Bnf7EU3X.cjs +1132 -0
- package/dist/pipeline-CctEa86r.d.cts +186 -0
- package/dist/pipeline-I8SLmV9S.d.ts +186 -0
- package/dist/{read-Ym1voUct.cjs → read-CZEWV4rK.cjs} +181 -17
- package/dist/{read-DDN5ZsPe.js → read-LWti17lz.js} +169 -5
- package/dist/read.cjs +1 -1
- package/dist/read.d.cts +78 -4
- package/dist/read.d.ts +78 -4
- package/dist/read.js +1 -1
- package/dist/render.cjs +751 -0
- package/dist/render.d.cts +215 -0
- package/dist/render.d.ts +215 -0
- package/dist/render.js +732 -0
- package/dist/{sheet-names-uT2EH5Ui.js → sheet-names-7p-joVsG.js} +2 -101
- package/dist/{sheet-names-qpXsvMpM.cjs → sheet-names-B8U5RAW0.cjs} +14 -167
- package/dist/warnings-B1v58nCZ.d.cts +41 -0
- package/dist/warnings-B1v58nCZ.d.ts +41 -0
- package/dist/worker.cjs +10 -2
- package/dist/worker.d.cts +10 -4
- package/dist/worker.d.ts +10 -4
- package/dist/worker.js +10 -2
- package/dist/{write-CYpLGuzl.d.ts → write-DM6ieuQY.d.ts} +2 -1
- package/dist/{write-DubvcG-x.js → write-DjgWy1PK.js} +5 -2
- package/dist/{write-C5JgeIar.d.cts → write-DtjfdIFm.d.cts} +2 -1
- package/dist/{write-BOh9jfu1.cjs → write-f9kcYf5K.cjs} +31 -28
- package/package.json +32 -1
- package/dist/read-C6L7Nyy3.d.cts +0 -78
- package/dist/read-Ddkks7qC.d.ts +0 -78
package/dist/import.cjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_pipeline = require("./pipeline-Bnf7EU3X.cjs");
|
|
3
|
+
exports.applyMapping = require_pipeline.applyMapping;
|
|
4
|
+
exports.coerceColumns = require_pipeline.coerceColumns;
|
|
5
|
+
exports.detectHeader = require_pipeline.detectHeader;
|
|
6
|
+
exports.importDataset = require_pipeline.importDataset;
|
|
7
|
+
exports.inferColumnTypes = require_pipeline.inferColumnTypes;
|
|
8
|
+
exports.mapColumns = require_pipeline.mapColumns;
|
|
9
|
+
exports.parseDate = require_pipeline.parseDate;
|
|
10
|
+
exports.parseNumber = require_pipeline.parseNumber;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* javascript-excel/import: a user's .xlsx or .csv file -> { columns, data }
|
|
3
|
+
* (docs/api.md §5.6). Header detection, type inference, locale-aware
|
|
4
|
+
* parsing and column mapping, plus the `importDataset` pipeline.
|
|
5
|
+
*/
|
|
6
|
+
import { A as parseDate, C as inferColumnTypes, D as detectHeader, E as ImportLocale, O as DateOrder, S as coerceColumns, T as HeaderDetection, _ as DatasetLike, a as importDataset, b as InferredColumn, c as ImportSchema, d as MappedDataset, f as MappingResult, g as ColumnType, h as CoerceResult, i as ImportProgress, j as parseNumber, k as NumberGroup, l as ImportedColumn, m as mapColumns, n as ImportDatasetResult, o as ColumnMapping, p as applyMapping, r as ImportMeta, s as FieldSpec, t as ImportDatasetOptions, u as MappableDataset, v as ImportIssue, w as DetectHeaderOptions, x as TypeOptions, y as ImportIssueCode } from "./pipeline-CctEa86r.cjs";
|
|
7
|
+
import { a as BlobType, i as BlobLike, n as ExcelWarningCode, r as BinaryInput, t as ExcelWarning } from "./warnings-B1v58nCZ.cjs";
|
|
8
|
+
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
9
|
+
import { ReadLimits, SheetInfo } from "./read.cjs";
|
|
10
|
+
export { type AbortSignalLike, type BinaryInput, type BlobLike, type BlobType, type CoerceResult, type ColumnMapping, type ColumnType, type DatasetLike, type DateOrder, type DetectHeaderOptions, type ExcelWarning, type ExcelWarningCode, type FieldSpec, type HeaderDetection, type ImportDatasetOptions, type ImportDatasetResult, type ImportIssue, type ImportIssueCode, type ImportLocale, type ImportMeta, type ImportProgress, type ImportSchema, type ImportedColumn, type InferredColumn, type MappableDataset, type MappedDataset, type MappingResult, type NumberGroup, type ReadLimits, type SheetInfo, type TypeOptions, applyMapping, coerceColumns, detectHeader, importDataset, inferColumnTypes, mapColumns, parseDate, parseNumber };
|
package/dist/import.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* javascript-excel/import: a user's .xlsx or .csv file -> { columns, data }
|
|
3
|
+
* (docs/api.md §5.6). Header detection, type inference, locale-aware
|
|
4
|
+
* parsing and column mapping, plus the `importDataset` pipeline.
|
|
5
|
+
*/
|
|
6
|
+
import { A as parseDate, C as inferColumnTypes, D as detectHeader, E as ImportLocale, O as DateOrder, S as coerceColumns, T as HeaderDetection, _ as DatasetLike, a as importDataset, b as InferredColumn, c as ImportSchema, d as MappedDataset, f as MappingResult, g as ColumnType, h as CoerceResult, i as ImportProgress, j as parseNumber, k as NumberGroup, l as ImportedColumn, m as mapColumns, n as ImportDatasetResult, o as ColumnMapping, p as applyMapping, r as ImportMeta, s as FieldSpec, t as ImportDatasetOptions, u as MappableDataset, v as ImportIssue, w as DetectHeaderOptions, x as TypeOptions, y as ImportIssueCode } from "./pipeline-I8SLmV9S.js";
|
|
7
|
+
import { a as BlobType, i as BlobLike, n as ExcelWarningCode, r as BinaryInput, t as ExcelWarning } from "./warnings-B1v58nCZ.js";
|
|
8
|
+
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
9
|
+
import { ReadLimits, SheetInfo } from "./read.js";
|
|
10
|
+
export { type AbortSignalLike, type BinaryInput, type BlobLike, type BlobType, type CoerceResult, type ColumnMapping, type ColumnType, type DatasetLike, type DateOrder, type DetectHeaderOptions, type ExcelWarning, type ExcelWarningCode, type FieldSpec, type HeaderDetection, type ImportDatasetOptions, type ImportDatasetResult, type ImportIssue, type ImportIssueCode, type ImportLocale, type ImportMeta, type ImportProgress, type ImportSchema, type ImportedColumn, type InferredColumn, type MappableDataset, type MappedDataset, type MappingResult, type NumberGroup, type ReadLimits, type SheetInfo, type TypeOptions, applyMapping, coerceColumns, detectHeader, importDataset, inferColumnTypes, mapColumns, parseDate, parseNumber };
|
package/dist/import.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as applyMapping, n as coerceColumns, o as detectHeader, t as importDataset, r as inferColumnTypes, a as mapColumns, s as parseDate, c as parseNumber } from "./pipeline-BAJtzBdW.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1,627 +1,44 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_errors = require("./errors-DOPrrGS4.cjs");
|
|
3
|
-
const require_write = require("./write-
|
|
4
|
-
const
|
|
5
|
-
const require_sheet_names = require("./sheet-names-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* `fromDataset` lays out header rows (with header groups as merged cells),
|
|
12
|
-
* data rows and an optional totals row; `fromDatasets` stacks several blocks
|
|
13
|
-
* on one sheet; `toDataset` goes the other way for import.
|
|
14
|
-
*/
|
|
15
|
-
function columnError(message, details = {}) {
|
|
16
|
-
return new require_errors.ValidationError("INVALID_COLUMN", message, { details });
|
|
17
|
-
}
|
|
18
|
-
const FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set([
|
|
19
|
-
"__proto__",
|
|
20
|
-
"prototype",
|
|
21
|
-
"constructor"
|
|
22
|
-
]);
|
|
23
|
-
/** Parses 'a.b', 'items[0].name', "a['x.y']" and 'a["x"]' into segments. */
|
|
24
|
-
function parsePath(path) {
|
|
25
|
-
const segs = [];
|
|
26
|
-
let i = 0;
|
|
27
|
-
const fail = () => {
|
|
28
|
-
throw columnError(`Invalid path ${JSON.stringify(path)}.`, { path });
|
|
29
|
-
};
|
|
30
|
-
if (typeof path !== "string" || path.length === 0) fail();
|
|
31
|
-
while (i < path.length) {
|
|
32
|
-
if (path[i] === "[") {
|
|
33
|
-
const q = path[i + 1];
|
|
34
|
-
if (q === "'" || q === "\"") {
|
|
35
|
-
const end = path.indexOf(`${q}]`, i + 2);
|
|
36
|
-
if (end < 0) fail();
|
|
37
|
-
segs.push(path.slice(i + 2, end));
|
|
38
|
-
i = end + 2;
|
|
39
|
-
} else {
|
|
40
|
-
const end = path.indexOf("]", i);
|
|
41
|
-
const n = path.slice(i + 1, end);
|
|
42
|
-
if (end < 0 || !/^\d+$/.test(n)) fail();
|
|
43
|
-
segs.push(n);
|
|
44
|
-
i = end + 1;
|
|
45
|
-
}
|
|
46
|
-
if (path[i] === ".") i++;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
let j = i;
|
|
50
|
-
while (j < path.length && path[j] !== "." && path[j] !== "[") j++;
|
|
51
|
-
if (j === i) fail();
|
|
52
|
-
segs.push(path.slice(i, j));
|
|
53
|
-
i = path[j] === "." ? j + 1 : j;
|
|
54
|
-
if (path[j] === "." && i >= path.length) fail();
|
|
55
|
-
}
|
|
56
|
-
for (const s of segs) if (FORBIDDEN_SEGMENTS.has(s)) throw columnError(`Path ${JSON.stringify(path)} uses the forbidden segment ${s}.`, {
|
|
57
|
-
path,
|
|
58
|
-
segment: s
|
|
59
|
-
});
|
|
60
|
-
return segs;
|
|
61
|
-
}
|
|
62
|
-
const own = (o, k) => o !== null && (typeof o === "object" || typeof o === "function") && Object.prototype.hasOwnProperty.call(o, k) ? o[k] : void 0;
|
|
63
|
-
function accessorOf(def, position) {
|
|
64
|
-
if ([
|
|
65
|
-
def.key !== void 0,
|
|
66
|
-
def.path !== void 0,
|
|
67
|
-
def.value !== void 0,
|
|
68
|
-
def.index !== void 0
|
|
69
|
-
].filter(Boolean).length > 1) throw columnError(`Column ${JSON.stringify(def.title ?? def.key ?? def.path)} has more than one accessor (key, path, value, index).`);
|
|
70
|
-
if (def.key !== void 0) {
|
|
71
|
-
if (typeof def.key !== "string") throw columnError("key must be a string.");
|
|
72
|
-
const key = def.key;
|
|
73
|
-
return (row) => own(row, key);
|
|
74
|
-
}
|
|
75
|
-
if (def.path !== void 0) {
|
|
76
|
-
const segs = parsePath(def.path);
|
|
77
|
-
return (row) => {
|
|
78
|
-
let v = row;
|
|
79
|
-
for (const s of segs) {
|
|
80
|
-
v = own(v, s);
|
|
81
|
-
if (v === void 0) return void 0;
|
|
82
|
-
}
|
|
83
|
-
return v;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
if (def.value !== void 0) {
|
|
87
|
-
if (typeof def.value !== "function") throw columnError("value must be a function.");
|
|
88
|
-
const fn = def.value;
|
|
89
|
-
return (row, rowIndex) => fn(row, { rowIndex });
|
|
90
|
-
}
|
|
91
|
-
const index = def.index ?? position;
|
|
92
|
-
if (!Number.isInteger(index) || index < 0) throw columnError(`index must be a non-negative integer, got ${String(def.index)}.`);
|
|
93
|
-
const named = def.index !== void 0;
|
|
94
|
-
return (row) => {
|
|
95
|
-
if (Array.isArray(row)) return row[index];
|
|
96
|
-
if (named || row === null || row === void 0) return void 0;
|
|
97
|
-
throw columnError(`Column ${JSON.stringify(def.title ?? `#${position + 1}`)} has no accessor (key, path, value or index) and the data rows are objects.`);
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const PLAIN_NUMBER = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
101
|
-
function isCellObject(v) {
|
|
102
|
-
return typeof v === "object" && v !== null && !(v instanceof Date) && !("error" in v) && !("richText" in v);
|
|
103
|
-
}
|
|
104
|
-
function coerce(v, type) {
|
|
105
|
-
if (v === null || v === void 0 || type === void 0 || type === "auto") return {
|
|
106
|
-
value: v,
|
|
107
|
-
failed: false
|
|
108
|
-
};
|
|
109
|
-
switch (type) {
|
|
110
|
-
case "string":
|
|
111
|
-
if (v instanceof Date) return {
|
|
112
|
-
value: Number.isFinite(v.getTime()) ? require_iso_date.isoDate(v, "local") : "",
|
|
113
|
-
failed: false
|
|
114
|
-
};
|
|
115
|
-
return {
|
|
116
|
-
value: typeof v === "object" ? require_sheet_names.cellText(v) : String(v),
|
|
117
|
-
failed: false
|
|
118
|
-
};
|
|
119
|
-
case "number":
|
|
120
|
-
if (typeof v === "number") return {
|
|
121
|
-
value: v,
|
|
122
|
-
failed: false
|
|
123
|
-
};
|
|
124
|
-
if (typeof v === "string" && PLAIN_NUMBER.test(v.trim())) return {
|
|
125
|
-
value: Number(v.trim()),
|
|
126
|
-
failed: false
|
|
127
|
-
};
|
|
128
|
-
return {
|
|
129
|
-
value: typeof v === "object" && !(v instanceof Date) ? require_sheet_names.cellText(v) : String(v instanceof Date ? require_iso_date.isoDate(v, "local") : v),
|
|
130
|
-
failed: true
|
|
131
|
-
};
|
|
132
|
-
case "boolean":
|
|
133
|
-
if (typeof v === "boolean") return {
|
|
134
|
-
value: v,
|
|
135
|
-
failed: false
|
|
136
|
-
};
|
|
137
|
-
if (typeof v === "string" && /^(true|false)$/i.test(v.trim())) return {
|
|
138
|
-
value: v.trim().toLowerCase() === "true",
|
|
139
|
-
failed: false
|
|
140
|
-
};
|
|
141
|
-
return {
|
|
142
|
-
value: typeof v === "object" ? require_sheet_names.cellText(v) : String(v),
|
|
143
|
-
failed: true
|
|
144
|
-
};
|
|
145
|
-
case "date":
|
|
146
|
-
case "datetime":
|
|
147
|
-
if (v instanceof Date) return Number.isFinite(v.getTime()) ? {
|
|
148
|
-
value: v,
|
|
149
|
-
failed: false
|
|
150
|
-
} : {
|
|
151
|
-
value: "Invalid Date",
|
|
152
|
-
failed: true
|
|
153
|
-
};
|
|
154
|
-
if (typeof v === "number" && Number.isFinite(v)) return {
|
|
155
|
-
value: new Date(v),
|
|
156
|
-
failed: false
|
|
157
|
-
};
|
|
158
|
-
if (typeof v === "string") {
|
|
159
|
-
const d = require_iso_date.parseIsoDate(v);
|
|
160
|
-
if (d) return {
|
|
161
|
-
value: d,
|
|
162
|
-
failed: false
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
return {
|
|
166
|
-
value: typeof v === "object" ? require_sheet_names.cellText(v) : String(v),
|
|
167
|
-
failed: true
|
|
168
|
-
};
|
|
169
|
-
default: throw columnError(`Unknown column type ${JSON.stringify(type)}.`, { type });
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
const set = (g, r, c, v) => {
|
|
173
|
-
if (r >= 1048576 || c >= 16384) throw new require_errors.ValidationError("OUT_OF_BOUNDS", `Dataset does not fit the sheet: ${require_sheet_names.encodeCol(Math.min(c, require_sheet_names.MAX_COLS - 1))}${r + 1} is out of bounds.`);
|
|
174
|
-
(g.rows[r] ??= [])[c] = v;
|
|
175
|
-
};
|
|
176
|
-
const range = (r1, c1, r2, c2) => {
|
|
177
|
-
const a = require_sheet_names.encodeCell({
|
|
178
|
-
row: r1,
|
|
179
|
-
col: c1
|
|
180
|
-
});
|
|
181
|
-
const b = require_sheet_names.encodeCell({
|
|
182
|
-
row: r2,
|
|
183
|
-
col: c2
|
|
184
|
-
});
|
|
185
|
-
return a === b ? a : `${a}:${b}`;
|
|
186
|
-
};
|
|
187
|
-
function normalise(defs) {
|
|
188
|
-
const out = [];
|
|
189
|
-
for (const d of defs) {
|
|
190
|
-
if (!d) continue;
|
|
191
|
-
if (typeof d !== "object") throw columnError("A column definition must be an object.");
|
|
192
|
-
if ("children" in d && d.children !== void 0) {
|
|
193
|
-
if (!Array.isArray(d.children)) throw columnError("children must be an array.");
|
|
194
|
-
const children = normalise(d.children);
|
|
195
|
-
if (children.length) out.push({
|
|
196
|
-
group: d,
|
|
197
|
-
children
|
|
198
|
-
});
|
|
199
|
-
} else out.push({ leaf: d });
|
|
200
|
-
}
|
|
201
|
-
return out;
|
|
202
|
-
}
|
|
203
|
-
const depthOf = (n) => "group" in n ? 1 + Math.max(...n.children.map(depthOf)) : 1;
|
|
204
|
-
const leafCount = (n) => "group" in n ? n.children.reduce((s, c) => s + leafCount(c), 0) : 1;
|
|
205
|
-
function titleCell(title, style) {
|
|
206
|
-
if (title === void 0) return style ? {
|
|
207
|
-
value: "",
|
|
208
|
-
style
|
|
209
|
-
} : "";
|
|
210
|
-
if (isCellObject(title)) return {
|
|
211
|
-
...title,
|
|
212
|
-
style: require_sheet_names.mergeStyles(style, title.style)
|
|
213
|
-
};
|
|
214
|
-
return style ? {
|
|
215
|
-
value: title,
|
|
216
|
-
style
|
|
217
|
-
} : title;
|
|
218
|
-
}
|
|
219
|
-
function layoutBlock(g, dataset, options, top, left, sheet) {
|
|
220
|
-
if (typeof dataset !== "object" || dataset === null || !Array.isArray(dataset.data)) throw columnError("A dataset needs a data array.");
|
|
221
|
-
const data = dataset.data;
|
|
222
|
-
let defs = dataset.columns;
|
|
223
|
-
let inferredArrays = false;
|
|
224
|
-
if (defs === void 0) {
|
|
225
|
-
const first = data.find((r) => r !== null && r !== void 0);
|
|
226
|
-
if (Array.isArray(first)) {
|
|
227
|
-
inferredArrays = true;
|
|
228
|
-
const width = data.reduce((m, r) => Array.isArray(r) ? Math.max(m, r.length) : m, 0);
|
|
229
|
-
defs = Array.from({ length: width }, (_, i) => ({ index: i }));
|
|
230
|
-
} else if (first !== void 0 && typeof first === "object") defs = Object.keys(first).map((key) => ({
|
|
231
|
-
title: key,
|
|
232
|
-
key
|
|
233
|
-
}));
|
|
234
|
-
else defs = [];
|
|
235
|
-
}
|
|
236
|
-
if (!Array.isArray(defs)) throw columnError("columns must be an array.");
|
|
237
|
-
const nodes = normalise(defs);
|
|
238
|
-
const leaves = [];
|
|
239
|
-
const collect = (n) => {
|
|
240
|
-
if ("group" in n) n.children.forEach(collect);
|
|
241
|
-
else {
|
|
242
|
-
const def = n.leaf;
|
|
243
|
-
leaves.push({
|
|
244
|
-
def,
|
|
245
|
-
col: leaves.length,
|
|
246
|
-
get: accessorOf(def, leaves.length)
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
nodes.forEach(collect);
|
|
251
|
-
const headerOn = options.header !== false && !inferredArrays && leaves.length > 0;
|
|
252
|
-
const headerRows = headerOn ? Math.max(...nodes.map(depthOf)) : 0;
|
|
253
|
-
const baseHeader = options.headerStyle ?? { font: { bold: true } };
|
|
254
|
-
for (const { def, col } of leaves) {
|
|
255
|
-
const c = left + col;
|
|
256
|
-
if (def.width === "auto" || def.width === void 0 && options.autoWidth) g.autoCols.add(c);
|
|
257
|
-
else if (def.width !== void 0 && !g.widths.has(c)) g.widths.set(c, def.width);
|
|
258
|
-
if (def.hidden) g.hidden.add(c);
|
|
259
|
-
}
|
|
260
|
-
if (headerOn) {
|
|
261
|
-
let next = 0;
|
|
262
|
-
const place = (n, level) => {
|
|
263
|
-
if ("group" in n) {
|
|
264
|
-
const span = leafCount(n);
|
|
265
|
-
const c = left + next;
|
|
266
|
-
set(g, top + level, c, titleCell(n.group.title, require_sheet_names.mergeStyles(baseHeader, n.group.headerStyle)));
|
|
267
|
-
if (span > 1) g.merges.push(range(top + level, c, top + level, c + span - 1));
|
|
268
|
-
n.children.forEach((child) => place(child, level + 1));
|
|
269
|
-
} else {
|
|
270
|
-
const def = n.leaf;
|
|
271
|
-
const c = left + next++;
|
|
272
|
-
const cell = titleCell(def.title ?? def.key ?? def.path ?? "", require_sheet_names.mergeStyles(baseHeader, def.headerStyle));
|
|
273
|
-
set(g, top + level, c, cell);
|
|
274
|
-
if (level < headerRows - 1) g.merges.push(range(top + level, c, top + headerRows - 1, c));
|
|
275
|
-
if (g.autoCols.has(c)) g.measured.set(c, Math.max(g.measured.get(c) ?? 0, require_sheet_names.textWidth(require_sheet_names.cellText(cell))));
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
nodes.forEach((n) => place(n, 0));
|
|
279
|
-
}
|
|
280
|
-
const warn = options.onWarning ?? (() => {});
|
|
281
|
-
const dataTop = top + headerRows;
|
|
282
|
-
const sampleRows = typeof options.autoWidth === "object" && options.autoWidth.sampleRows !== void 0 ? options.autoWidth.sampleRows : 1e400;
|
|
283
|
-
const columnValues = leaves.map(() => []);
|
|
284
|
-
const columnStyles = leaves.map(({ def }) => {
|
|
285
|
-
const typeFmt = def.type === "date" ? { numFmt: 14 } : def.type === "datetime" ? { numFmt: 22 } : void 0;
|
|
286
|
-
const merged = require_sheet_names.mergeStyles(typeFmt, def.style, def.numFmt !== void 0 ? { numFmt: def.numFmt } : void 0);
|
|
287
|
-
return Object.keys(merged).length ? merged : void 0;
|
|
288
|
-
});
|
|
289
|
-
const rowMerges = /* @__PURE__ */ new WeakMap();
|
|
290
|
-
const styleFor = (col, rowStyle, cellStyle) => {
|
|
291
|
-
if (cellStyle) return require_sheet_names.mergeStyles(columnStyles[col], rowStyle, cellStyle);
|
|
292
|
-
if (!rowStyle) return columnStyles[col];
|
|
293
|
-
let perColumn = rowMerges.get(rowStyle);
|
|
294
|
-
if (!perColumn) rowMerges.set(rowStyle, perColumn = []);
|
|
295
|
-
if (!(col in perColumn)) perColumn[col] = require_sheet_names.mergeStyles(columnStyles[col], rowStyle);
|
|
296
|
-
return perColumn[col];
|
|
297
|
-
};
|
|
298
|
-
data.forEach((row, i) => {
|
|
299
|
-
const r = dataTop + i;
|
|
300
|
-
const rowStyle = options.rowStyle?.(row, i);
|
|
301
|
-
for (const { def, col, get } of leaves) {
|
|
302
|
-
const c = left + col;
|
|
303
|
-
const refOf = () => require_sheet_names.encodeCell({
|
|
304
|
-
row: r,
|
|
305
|
-
col: c
|
|
306
|
-
});
|
|
307
|
-
const raw = get(row, i);
|
|
308
|
-
let cell = isCellObject(raw) ? { ...raw } : { value: raw };
|
|
309
|
-
if (!cell.formula) {
|
|
310
|
-
const { value, failed } = coerce(cell.value, def.type);
|
|
311
|
-
if (failed) {
|
|
312
|
-
const ref = refOf();
|
|
313
|
-
warn({
|
|
314
|
-
code: "COERCION_FAILED",
|
|
315
|
-
message: `${sheet}!${ref}: value does not fit type '${def.type}'; written as text.`,
|
|
316
|
-
sheet,
|
|
317
|
-
ref
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
cell.value = value;
|
|
321
|
-
}
|
|
322
|
-
if (typeof cell.value === "number" && !Number.isFinite(cell.value)) {
|
|
323
|
-
const ref = refOf();
|
|
324
|
-
warn({
|
|
325
|
-
code: "NON_FINITE_NUMBER",
|
|
326
|
-
message: `${sheet}!${ref}: ${String(cell.value)} cannot be stored; the cell is left empty.`,
|
|
327
|
-
sheet,
|
|
328
|
-
ref
|
|
329
|
-
});
|
|
330
|
-
cell = {
|
|
331
|
-
...cell,
|
|
332
|
-
value: null
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
const style = styleFor(col, rowStyle, isCellObject(raw) ? raw.style : void 0);
|
|
336
|
-
const out = style !== void 0 && Object.keys(style).length > 0 ? {
|
|
337
|
-
...cell,
|
|
338
|
-
style
|
|
339
|
-
} : Object.keys(cell).length === 1 && "value" in cell ? cell.value : cell;
|
|
340
|
-
if (out !== void 0 && out !== null) set(g, r, c, out);
|
|
341
|
-
const v = cell.value;
|
|
342
|
-
if (v !== null && v !== void 0) columnValues[col].push(v);
|
|
343
|
-
if (i < sampleRows && g.autoCols.has(c)) g.measured.set(c, Math.max(g.measured.get(c) ?? 0, require_sheet_names.textWidth(require_sheet_names.cellText(out))));
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
const lastDataRow = dataTop + data.length - 1;
|
|
347
|
-
const hasTotals = leaves.some(({ def }) => def.total !== void 0);
|
|
348
|
-
let lastRow = Math.max(top + headerRows - 1, lastDataRow);
|
|
349
|
-
if (hasTotals) {
|
|
350
|
-
const r = lastDataRow + 1;
|
|
351
|
-
const totalsStyle = options.totals?.style;
|
|
352
|
-
leaves.forEach(({ def, col }, k) => {
|
|
353
|
-
const c = left + col;
|
|
354
|
-
const values = columnValues[col];
|
|
355
|
-
const dataRange = data.length ? range(dataTop, c, lastDataRow, c) : "";
|
|
356
|
-
let cell;
|
|
357
|
-
if (def.total === void 0) {
|
|
358
|
-
if (k !== 0 || options.totals?.label === void 0) return;
|
|
359
|
-
cell = {
|
|
360
|
-
value: options.totals.label,
|
|
361
|
-
...totalsStyle ? { style: totalsStyle } : {}
|
|
362
|
-
};
|
|
363
|
-
} else {
|
|
364
|
-
cell = totalCell(def.total, dataRange, values);
|
|
365
|
-
const base = def.total === "count" ? {
|
|
366
|
-
...columnStyles[col],
|
|
367
|
-
numFmt: void 0
|
|
368
|
-
} : columnStyles[col];
|
|
369
|
-
const cellStyle = isCellObject(cell) ? cell.style : void 0;
|
|
370
|
-
const style = require_sheet_names.mergeStyles(base, totalsStyle, cellStyle);
|
|
371
|
-
if (Object.keys(style).length) cell = isCellObject(cell) ? {
|
|
372
|
-
...cell,
|
|
373
|
-
style
|
|
374
|
-
} : {
|
|
375
|
-
value: cell,
|
|
376
|
-
style
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
set(g, r, c, cell);
|
|
380
|
-
if (g.autoCols.has(c)) g.measured.set(c, Math.max(g.measured.get(c) ?? 0, require_sheet_names.textWidth(require_sheet_names.cellText(cell))));
|
|
381
|
-
});
|
|
382
|
-
lastRow = r;
|
|
383
|
-
}
|
|
384
|
-
return {
|
|
385
|
-
headerRows,
|
|
386
|
-
firstRow: top,
|
|
387
|
-
lastHeaderRow: top + headerRows - 1,
|
|
388
|
-
lastDataRow: Math.max(lastDataRow, top + headerRows - 1),
|
|
389
|
-
firstCol: left,
|
|
390
|
-
lastCol: left + Math.max(leaves.length, 1) - 1,
|
|
391
|
-
lastRow
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
const SUBTOTAL = {
|
|
395
|
-
sum: 109,
|
|
396
|
-
average: 101,
|
|
397
|
-
count: 103,
|
|
398
|
-
min: 105,
|
|
399
|
-
max: 104
|
|
400
|
-
};
|
|
401
|
-
function numeric(values) {
|
|
402
|
-
const out = [];
|
|
403
|
-
for (const v of values) if (typeof v === "number") out.push(v);
|
|
404
|
-
else if (v instanceof Date) try {
|
|
405
|
-
out.push(require_numfmt.dateToSerial(v));
|
|
406
|
-
} catch {}
|
|
407
|
-
return out;
|
|
408
|
-
}
|
|
409
|
-
function totalCell(total, dataRange, values) {
|
|
410
|
-
if (typeof total === "function") return total({
|
|
411
|
-
range: dataRange,
|
|
412
|
-
values
|
|
413
|
-
});
|
|
414
|
-
if (typeof total === "string" && total in SUBTOTAL) {
|
|
415
|
-
const nums = numeric(values);
|
|
416
|
-
let cached;
|
|
417
|
-
switch (total) {
|
|
418
|
-
case "sum":
|
|
419
|
-
cached = nums.reduce((a, b) => a + b, 0);
|
|
420
|
-
break;
|
|
421
|
-
case "average":
|
|
422
|
-
cached = nums.length ? nums.reduce((a, b) => a + b, 0) / nums.length : { error: "#DIV/0!" };
|
|
423
|
-
break;
|
|
424
|
-
case "count":
|
|
425
|
-
cached = values.length;
|
|
426
|
-
break;
|
|
427
|
-
case "min":
|
|
428
|
-
cached = nums.length ? Math.min(...nums) : 0;
|
|
429
|
-
break;
|
|
430
|
-
default: cached = nums.length ? Math.max(...nums) : 0;
|
|
431
|
-
}
|
|
432
|
-
return dataRange ? {
|
|
433
|
-
formula: `SUBTOTAL(${SUBTOTAL[total]},${dataRange})`,
|
|
434
|
-
value: cached
|
|
435
|
-
} : { value: cached };
|
|
436
|
-
}
|
|
437
|
-
return total;
|
|
438
|
-
}
|
|
439
|
-
function finish(g, options, first, name) {
|
|
440
|
-
const sheet = {
|
|
441
|
-
name,
|
|
442
|
-
rows: g.rows
|
|
443
|
-
};
|
|
444
|
-
if (g.merges.length) sheet.merges = g.merges;
|
|
445
|
-
const auto = typeof options.autoWidth === "object" ? options.autoWidth : {};
|
|
446
|
-
const min = auto.min ?? require_sheet_names.AUTO_WIDTH.min;
|
|
447
|
-
const max = Math.min(255, auto.max ?? require_sheet_names.AUTO_WIDTH.max);
|
|
448
|
-
const cols = /* @__PURE__ */ new Set([
|
|
449
|
-
...g.widths.keys(),
|
|
450
|
-
...g.autoCols,
|
|
451
|
-
...g.hidden
|
|
452
|
-
]);
|
|
453
|
-
if (cols.size) {
|
|
454
|
-
const colProps = [];
|
|
455
|
-
for (const c of [...cols].sort((a, b) => a - b)) {
|
|
456
|
-
const p = {};
|
|
457
|
-
const w = g.autoCols.has(c) ? Math.min(max, Math.max(min, (g.measured.get(c) ?? 0) + require_sheet_names.AUTO_WIDTH.padding)) : g.widths.get(c);
|
|
458
|
-
if (w !== void 0) p.width = w;
|
|
459
|
-
if (g.hidden.has(c)) p.hidden = true;
|
|
460
|
-
colProps[c] = p;
|
|
461
|
-
}
|
|
462
|
-
sheet.colProps = colProps;
|
|
463
|
-
}
|
|
464
|
-
const view = {};
|
|
465
|
-
if (options.rightToLeft) view.rightToLeft = true;
|
|
466
|
-
if (options.freezeHeader && first && first.headerRows > 0) view.freeze = { rows: first.lastHeaderRow + 1 };
|
|
467
|
-
if (Object.keys(view).length) sheet.view = view;
|
|
468
|
-
if (options.autoFilter && first && first.headerRows > 0) sheet.autoFilter = range(first.lastHeaderRow, first.firstCol, first.lastDataRow, first.lastCol);
|
|
469
|
-
return sheet;
|
|
470
|
-
}
|
|
471
|
-
function sheetName(options) {
|
|
472
|
-
const name = options.name ?? "Sheet1";
|
|
473
|
-
const problem = require_sheet_names.validateSheetName(name);
|
|
474
|
-
if (problem) throw new require_errors.ValidationError("INVALID_SHEET_NAME", `Sheet name ${JSON.stringify(name)} is invalid (${problem}).`, { details: {
|
|
475
|
-
sheet: name,
|
|
476
|
-
problem
|
|
477
|
-
} });
|
|
478
|
-
return name;
|
|
479
|
-
}
|
|
480
|
-
function originOf(options) {
|
|
481
|
-
if (options.origin === void 0) return {
|
|
482
|
-
row: 0,
|
|
483
|
-
col: 0
|
|
484
|
-
};
|
|
485
|
-
return require_sheet_names.decodeCell(options.origin);
|
|
486
|
-
}
|
|
487
|
-
const newGrid = () => ({
|
|
488
|
-
rows: [],
|
|
489
|
-
merges: [],
|
|
490
|
-
widths: /* @__PURE__ */ new Map(),
|
|
491
|
-
measured: /* @__PURE__ */ new Map(),
|
|
492
|
-
autoCols: /* @__PURE__ */ new Set(),
|
|
493
|
-
hidden: /* @__PURE__ */ new Set()
|
|
494
|
-
});
|
|
495
|
-
/** Builds a sheet from `{ columns, data }`. */
|
|
496
|
-
function fromDataset(dataset, options = {}) {
|
|
497
|
-
const name = sheetName(options);
|
|
498
|
-
const origin = originOf(options);
|
|
499
|
-
const g = newGrid();
|
|
500
|
-
return finish(g, options, layoutBlock(g, dataset, options, origin.row, origin.col, name), name);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Stacks several datasets on one sheet (replaces the old xSteps/ySteps).
|
|
504
|
-
* Each block starts `gap` empty rows (default 1) below the previous one, or
|
|
505
|
-
* `offset.rows` rows when given, and `offset.cols` columns right of the
|
|
506
|
-
* origin. Freeze and filter apply to the first block with header rows.
|
|
507
|
-
*/
|
|
508
|
-
function fromDatasets(blocks, options = {}) {
|
|
509
|
-
if (!Array.isArray(blocks)) throw columnError("fromDatasets needs an array of datasets.");
|
|
510
|
-
const name = sheetName(options);
|
|
511
|
-
const origin = originOf(options);
|
|
512
|
-
const gap = options.gap ?? 1;
|
|
513
|
-
if (!Number.isInteger(gap) || gap < 0) throw columnError(`gap must be a non-negative integer, got ${String(gap)}.`);
|
|
514
|
-
const g = newGrid();
|
|
515
|
-
let first;
|
|
516
|
-
let nextRow = origin.row;
|
|
517
|
-
blocks.forEach((block, i) => {
|
|
518
|
-
const offRows = block.offset?.rows;
|
|
519
|
-
const offCols = block.offset?.cols ?? 0;
|
|
520
|
-
const top = i === 0 ? origin.row + (offRows ?? 0) : nextRow + (offRows ?? gap);
|
|
521
|
-
const result = layoutBlock(g, block, options, top, origin.col + offCols, name);
|
|
522
|
-
if (!first && result.headerRows > 0) first = result;
|
|
523
|
-
nextRow = result.lastRow + 1;
|
|
524
|
-
});
|
|
525
|
-
return finish(g, options, first, name);
|
|
526
|
-
}
|
|
527
|
-
function usedRange(sheet) {
|
|
528
|
-
let minR = 1e400, maxR = -1, minC = 1e400, maxC = -1;
|
|
529
|
-
sheet.rows.forEach((row, r) => row?.forEach((c, col) => {
|
|
530
|
-
if (c === void 0 || c === null) return;
|
|
531
|
-
minR = Math.min(minR, r);
|
|
532
|
-
maxR = Math.max(maxR, r);
|
|
533
|
-
minC = Math.min(minC, col);
|
|
534
|
-
maxC = Math.max(maxC, col);
|
|
535
|
-
}));
|
|
536
|
-
return maxR < 0 ? void 0 : {
|
|
537
|
-
start: {
|
|
538
|
-
row: minR,
|
|
539
|
-
col: minC
|
|
540
|
-
},
|
|
541
|
-
end: {
|
|
542
|
-
row: maxR,
|
|
543
|
-
col: maxC
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* Reads a sheet back into `{ columns, data }` (import direction). Keys come
|
|
549
|
-
* from the header text, deduplicated with _2, _3...; an empty header gives the
|
|
550
|
-
* column letter. Empty rows are skipped. Rows are null-prototype objects, so
|
|
551
|
-
* a header named __proto__ in an untrusted file is just a key.
|
|
552
|
-
*/
|
|
553
|
-
function toDataset(sheet, options = {}) {
|
|
554
|
-
const s = sheet;
|
|
555
|
-
const rng = options.range ? require_sheet_names.decodeRange(options.range) : s.dimension ? require_sheet_names.decodeRange(s.dimension) : usedRange(s);
|
|
556
|
-
if (!rng) return {
|
|
557
|
-
columns: [],
|
|
558
|
-
data: []
|
|
559
|
-
};
|
|
560
|
-
const headerRow = options.headerRow ?? 0;
|
|
561
|
-
if (headerRow !== false && (!Number.isInteger(headerRow) || headerRow < 0)) throw columnError(`headerRow must be a non-negative integer or false, got ${String(headerRow)}.`);
|
|
562
|
-
const asCell = options.values === "cell";
|
|
563
|
-
const columns = [];
|
|
564
|
-
const used = /* @__PURE__ */ new Map();
|
|
565
|
-
for (let c = rng.start.col; c <= rng.end.col; c++) {
|
|
566
|
-
const letter = require_sheet_names.encodeCol(c);
|
|
567
|
-
const title = headerRow === false ? letter : require_sheet_names.cellText(s.rows[headerRow]?.[c]).trim();
|
|
568
|
-
const base = title === "" ? letter : title;
|
|
569
|
-
const n = (used.get(base) ?? 0) + 1;
|
|
570
|
-
used.set(base, n);
|
|
571
|
-
columns.push({
|
|
572
|
-
title: headerRow === false ? letter : title,
|
|
573
|
-
key: n === 1 ? base : `${base}_${n}`
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
const data = [];
|
|
577
|
-
const firstData = headerRow === false ? rng.start.row : Math.max(rng.start.row, headerRow + 1);
|
|
578
|
-
for (let r = firstData; r <= rng.end.row; r++) {
|
|
579
|
-
const row = s.rows[r];
|
|
580
|
-
if (!row) continue;
|
|
581
|
-
let any = false;
|
|
582
|
-
const obj = Object.create(null);
|
|
583
|
-
columns.forEach(({ key }, k) => {
|
|
584
|
-
const c = row[rng.start.col + k];
|
|
585
|
-
if (!(c === void 0 || c === null || isCellObject(c) && (c.value === void 0 || c.value === null) && !c.formula)) any = true;
|
|
586
|
-
obj[key] = asCell ? c === void 0 ? null : isCellObject(c) ? c : { value: c } : c === void 0 || c === null ? null : isCellObject(c) ? c.value ?? null : c;
|
|
587
|
-
});
|
|
588
|
-
if (any) data.push(obj);
|
|
589
|
-
}
|
|
590
|
-
return {
|
|
591
|
-
columns,
|
|
592
|
-
data
|
|
593
|
-
};
|
|
594
|
-
}
|
|
3
|
+
const require_write = require("./write-f9kcYf5K.cjs");
|
|
4
|
+
const require_dates = require("./dates-CA1dCizp.cjs");
|
|
5
|
+
const require_sheet_names = require("./sheet-names-B8U5RAW0.cjs");
|
|
6
|
+
const require_colors = require("./colors-oBpjx97l.cjs");
|
|
7
|
+
const require_cells = require("./cells-CPXU722t.cjs");
|
|
8
|
+
const require_dataset = require("./dataset-UUZCzsi3.cjs");
|
|
9
|
+
const require_numfmt = require("./numfmt-BmEbm78Y.cjs");
|
|
10
|
+
const require_address = require("./address-DZBHchLv.cjs");
|
|
595
11
|
// src/index.ts
|
|
596
12
|
/** Package version. Set from package.json by `npm run version-packages` (scripts/sync-version.mjs); a unit test checks it. */
|
|
597
|
-
const VERSION = "2.0.0-alpha.
|
|
13
|
+
const VERSION = "2.0.0-alpha.3";
|
|
598
14
|
exports.BUILTIN_NUM_FMTS = require_numfmt.BUILTIN_NUM_FMTS;
|
|
599
15
|
exports.CsvError = require_errors.CsvError;
|
|
600
16
|
exports.EnvironmentError = require_errors.EnvironmentError;
|
|
601
17
|
exports.ExcelError = require_errors.ExcelError;
|
|
602
18
|
exports.FormatError = require_errors.FormatError;
|
|
603
19
|
exports.LimitError = require_errors.LimitError;
|
|
604
|
-
exports.MAX_COLS =
|
|
605
|
-
exports.MAX_ROWS =
|
|
20
|
+
exports.MAX_COLS = require_address.MAX_COLS;
|
|
21
|
+
exports.MAX_ROWS = require_address.MAX_ROWS;
|
|
606
22
|
exports.VERSION = VERSION;
|
|
607
23
|
exports.ValidationError = require_errors.ValidationError;
|
|
608
24
|
exports.XLSX_MIME = require_write.XLSX_MIME;
|
|
609
|
-
exports.cellText =
|
|
610
|
-
exports.dateToSerial =
|
|
611
|
-
exports.decodeCell =
|
|
612
|
-
exports.decodeCol =
|
|
613
|
-
exports.decodeRange =
|
|
614
|
-
exports.encodeCell =
|
|
615
|
-
exports.encodeCol =
|
|
616
|
-
exports.encodeRange =
|
|
617
|
-
exports.fromDataset = fromDataset;
|
|
618
|
-
exports.fromDatasets = fromDatasets;
|
|
25
|
+
exports.cellText = require_cells.cellText;
|
|
26
|
+
exports.dateToSerial = require_dates.dateToSerial;
|
|
27
|
+
exports.decodeCell = require_address.decodeCell;
|
|
28
|
+
exports.decodeCol = require_address.decodeCol;
|
|
29
|
+
exports.decodeRange = require_address.decodeRange;
|
|
30
|
+
exports.encodeCell = require_address.encodeCell;
|
|
31
|
+
exports.encodeCol = require_address.encodeCol;
|
|
32
|
+
exports.encodeRange = require_address.encodeRange;
|
|
33
|
+
exports.fromDataset = require_dataset.fromDataset;
|
|
34
|
+
exports.fromDatasets = require_dataset.fromDatasets;
|
|
619
35
|
exports.isDateFormat = require_numfmt.isDateFormat;
|
|
620
36
|
exports.isExcelError = require_errors.isExcelError;
|
|
621
37
|
exports.mergeStyles = require_sheet_names.mergeStyles;
|
|
38
|
+
exports.resolveColor = require_colors.resolveColor;
|
|
622
39
|
exports.sanitizeSheetName = require_sheet_names.sanitizeSheetName;
|
|
623
|
-
exports.serialToDate =
|
|
40
|
+
exports.serialToDate = require_dates.serialToDate;
|
|
624
41
|
exports.toBlob = require_write.toBlob;
|
|
625
|
-
exports.toDataset = toDataset;
|
|
42
|
+
exports.toDataset = require_dataset.toDataset;
|
|
626
43
|
exports.toUint8Array = require_write.toUint8Array;
|
|
627
44
|
exports.validateSheetName = require_sheet_names.validateSheetName;
|