javascript-excel 2.2.0 → 2.4.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/README.md +4 -2
- package/dist/{csv-DzGOFyHs.cjs → csv-DZ241Y5F.cjs} +57 -5
- package/dist/{csv-CrWF7JS1.js → csv-Dn4MIESx.js} +52 -6
- package/dist/csv.cjs +1 -1
- package/dist/csv.d.cts +16 -0
- package/dist/csv.d.ts +16 -0
- package/dist/csv.js +1 -1
- package/dist/{dataset-DzoMeOG1.cjs → dataset-CbZnEWXu.cjs} +45 -1
- package/dist/{dataset-BLo9CwB-.js → dataset-CyEHVht4.js} +46 -2
- package/dist/import.cjs +1 -1
- package/dist/import.d.cts +2 -2
- package/dist/import.d.ts +2 -2
- package/dist/import.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{pipeline-C63qD7Ym.d.cts → pipeline-4U7Xnuc1.d.cts} +43 -6
- package/dist/{pipeline-6PmlmH1-.d.ts → pipeline-BegSPu8X.d.ts} +43 -6
- package/dist/{pipeline-DLYtAkPU.cjs → pipeline-BwkRpV5Z.cjs} +293 -138
- package/dist/{pipeline-BNhGRJcx.js → pipeline-C8F9lecW.js} +293 -138
- package/dist/{read-D5Gz4ph8.cjs → read-DmUPztqh.cjs} +544 -141
- package/dist/{read-CFmZioBG.js → read-cvxu6O-H.js} +521 -142
- package/dist/read.cjs +1 -1
- package/dist/read.d.cts +44 -3
- package/dist/read.d.ts +44 -3
- package/dist/read.js +1 -1
- package/dist/worker.cjs +3 -3
- package/dist/worker.d.cts +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +3 -3
- package/package.json +1 -1
|
@@ -13,15 +13,27 @@ declare function parseNumber(text: string, options?: {
|
|
|
13
13
|
group?: NumberGroup;
|
|
14
14
|
}): number | undefined;
|
|
15
15
|
type DateOrder = "YMD" | "DMY" | "MDY";
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* ISO 8601 always; numeric dates (d/m/yyyy, …) only with `order`. Two-digit
|
|
18
|
+
* years only with `twoDigitYearPivot` and a DMY or MDY order.
|
|
19
|
+
*/
|
|
17
20
|
declare function parseDate(text: string, options?: {
|
|
18
|
-
order?: DateOrder;
|
|
19
|
-
zone?: "local" | "utc";
|
|
21
|
+
order?: DateOrder | undefined;
|
|
22
|
+
zone?: "local" | "utc" | undefined;
|
|
23
|
+
twoDigitYearPivot?: number | undefined;
|
|
20
24
|
}): Date | undefined;
|
|
21
25
|
interface ImportLocale {
|
|
22
26
|
decimal?: "." | "," | undefined;
|
|
23
27
|
group?: NumberGroup | undefined;
|
|
24
28
|
dateOrder?: "auto" | "YMD" | "DMY" | "MDY" | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Accept two-digit years in numeric dates such as 31.10.26 (DMY) or
|
|
31
|
+
* 10/31/26 (MDY): a year yy below the pivot is 20yy, from it on 19yy.
|
|
32
|
+
* An integer from 0 to 100; 30 is Excel's rule (00–29 → 2000s, 30–99 → 1900s).
|
|
33
|
+
* Needs an explicit DMY or MDY `dateOrder`; 'auto' leaves such columns text.
|
|
34
|
+
* Default undefined: two-digit years are not accepted.
|
|
35
|
+
*/
|
|
36
|
+
twoDigitYearPivot?: number | undefined;
|
|
25
37
|
}
|
|
26
38
|
interface DetectHeaderOptions {
|
|
27
39
|
range?: string | undefined;
|
|
@@ -35,7 +47,13 @@ interface HeaderDetection {
|
|
|
35
47
|
confidence: "high" | "low";
|
|
36
48
|
}
|
|
37
49
|
declare function detectHeader(sheet: Sheet<CellInput>, options?: DetectHeaderOptions): HeaderDetection;
|
|
38
|
-
|
|
50
|
+
/**
|
|
51
|
+
* A column's type. `'day'` is never inferred: forced (by `types` or a schema
|
|
52
|
+
* field), it converts like `'date'` and then drops the time of day, giving
|
|
53
|
+
* 00:00 of the calendar day in `dateZone`; for ISO text with an offset, the
|
|
54
|
+
* day written (docs/api.md §5.6, "Type rules").
|
|
55
|
+
*/
|
|
56
|
+
type ColumnType = "string" | "number" | "boolean" | "date" | "datetime" | "day" | "mixed" | "empty";
|
|
39
57
|
interface DatasetLike {
|
|
40
58
|
columns: ReadonlyArray<{
|
|
41
59
|
key: string;
|
|
@@ -152,7 +170,19 @@ interface ImportDatasetOptions {
|
|
|
152
170
|
mapping?: ColumnMapping | undefined;
|
|
153
171
|
maxRows?: number | undefined;
|
|
154
172
|
preview?: number | undefined;
|
|
155
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Issues kept in `issues` (added in 2.3). Past it, an issue is counted in `meta.droppedIssues`
|
|
175
|
+
* instead, unless it is the first of its code, so every kind of issue that occurred is listed at
|
|
176
|
+
* least once (and so is an `error` severity, if any). An integer of at least 1, or `Infinity` for no
|
|
177
|
+
* cap; default 100,000.
|
|
178
|
+
*/
|
|
179
|
+
maxIssues?: number | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* Reader limits for xlsx. For a CSV file, `maxWarnings` caps its warnings,
|
|
182
|
+
* `maxCellTextLength` limits its fields (raising CSV's 1 MiB `maxFieldBytes` to match)
|
|
183
|
+
* and `maxColumns` the fields of one record. For both formats, `maxCells` also bounds
|
|
184
|
+
* the empty fields the dataset pads short rows with (since 2.4; docs/api.md §5.6).
|
|
185
|
+
*/
|
|
156
186
|
limits?: Partial<ReadLimits> | undefined;
|
|
157
187
|
signal?: AbortSignalLike | undefined;
|
|
158
188
|
onProgress?: ((p: ImportProgress) => void) | undefined;
|
|
@@ -179,6 +209,13 @@ interface ImportMeta {
|
|
|
179
209
|
truncated: boolean;
|
|
180
210
|
mapping?: ColumnMapping | undefined;
|
|
181
211
|
unmappedColumns?: string[] | undefined;
|
|
212
|
+
/** Set only when `maxIssues` dropped issues: how many, by code (added in 2.3). */
|
|
213
|
+
droppedIssues?: DroppedIssues | undefined;
|
|
214
|
+
}
|
|
215
|
+
/** Issues `maxIssues` kept out of `ImportDatasetResult.issues`. */
|
|
216
|
+
interface DroppedIssues {
|
|
217
|
+
total: number;
|
|
218
|
+
byCode: Partial<Record<ImportIssueCode, number>>;
|
|
182
219
|
}
|
|
183
220
|
interface ImportDatasetResult {
|
|
184
221
|
columns: ImportedColumn[];
|
|
@@ -189,4 +226,4 @@ interface ImportDatasetResult {
|
|
|
189
226
|
meta: ImportMeta;
|
|
190
227
|
}
|
|
191
228
|
declare function importDataset(input: string | BinaryInput, options?: ImportDatasetOptions): Promise<ImportDatasetResult>;
|
|
192
|
-
export {
|
|
229
|
+
export { NumberGroup as A, coerceColumns as C, ImportLocale as D, HeaderDetection as E, parseNumber as M, detectHeader as O, TypeOptions as S, DetectHeaderOptions as T, ColumnType as _, ImportProgress as a, ImportIssueCode as b, FieldSpec as c, MappableDataset as d, MappedDataset as f, CoerceResult as g, mapColumns as h, ImportMeta as i, parseDate as j, DateOrder as k, ImportSchema as l, applyMapping as m, ImportDatasetOptions as n, importDataset as o, MappingResult as p, ImportDatasetResult as r, ColumnMapping as s, DroppedIssues as t, ImportedColumn as u, DatasetLike as v, inferColumnTypes as w, InferredColumn as x, ImportIssue as y };
|