javascript-excel 2.1.0 → 2.3.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-CrWF7JS1.js → csv-Bck8eW_D.js} +29 -7
- package/dist/{csv-DzGOFyHs.cjs → csv-f4P3fGs-.cjs} +34 -6
- package/dist/csv.cjs +1 -1
- package/dist/csv.d.cts +8 -0
- package/dist/csv.d.ts +8 -0
- package/dist/csv.js +1 -1
- 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 +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{pipeline-CMealW1i.js → pipeline-2dgQM9E9.js} +267 -134
- package/dist/{pipeline-6PmlmH1-.d.ts → pipeline-Bh7FUyzW.d.ts} +40 -6
- package/dist/{pipeline-C63qD7Ym.d.cts → pipeline-D1eAhqJu.d.cts} +40 -6
- package/dist/{pipeline-Dc15gn1t.cjs → pipeline-LCTU0Eg_.cjs} +267 -134
- package/dist/{read-DYDDLxUE.cjs → read-BYI7EVMo.cjs} +525 -96
- package/dist/{read-CFQ09LlL.js → read-BnXzPjGc.js} +514 -97
- package/dist/read.cjs +1 -1
- package/dist/read.d.cts +55 -3
- package/dist/read.d.ts +55 -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,12 @@ 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` (docs/api.md §5.6, "Type rules").
|
|
54
|
+
*/
|
|
55
|
+
type ColumnType = "string" | "number" | "boolean" | "date" | "datetime" | "day" | "mixed" | "empty";
|
|
39
56
|
interface DatasetLike {
|
|
40
57
|
columns: ReadonlyArray<{
|
|
41
58
|
key: string;
|
|
@@ -152,7 +169,17 @@ interface ImportDatasetOptions {
|
|
|
152
169
|
mapping?: ColumnMapping | undefined;
|
|
153
170
|
maxRows?: number | undefined;
|
|
154
171
|
preview?: number | undefined;
|
|
155
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* Issues kept in `issues` (added in 2.3). Past it, an issue is counted in `meta.droppedIssues`
|
|
174
|
+
* instead, unless it is the first of its code, so every kind of issue that occurred is listed at
|
|
175
|
+
* least once (and so is an `error` severity, if any). An integer of at least 1, or `Infinity` for no
|
|
176
|
+
* cap; default 100,000.
|
|
177
|
+
*/
|
|
178
|
+
maxIssues?: number | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Reader limits for xlsx. For a CSV file, `maxWarnings` caps its warnings and
|
|
181
|
+
* `maxCellTextLength` limits its fields (raising CSV's 1 MiB `maxFieldBytes` to match).
|
|
182
|
+
*/
|
|
156
183
|
limits?: Partial<ReadLimits> | undefined;
|
|
157
184
|
signal?: AbortSignalLike | undefined;
|
|
158
185
|
onProgress?: ((p: ImportProgress) => void) | undefined;
|
|
@@ -179,6 +206,13 @@ interface ImportMeta {
|
|
|
179
206
|
truncated: boolean;
|
|
180
207
|
mapping?: ColumnMapping | undefined;
|
|
181
208
|
unmappedColumns?: string[] | undefined;
|
|
209
|
+
/** Set only when `maxIssues` dropped issues: how many, by code (added in 2.3). */
|
|
210
|
+
droppedIssues?: DroppedIssues | undefined;
|
|
211
|
+
}
|
|
212
|
+
/** Issues `maxIssues` kept out of `ImportDatasetResult.issues`. */
|
|
213
|
+
interface DroppedIssues {
|
|
214
|
+
total: number;
|
|
215
|
+
byCode: Partial<Record<ImportIssueCode, number>>;
|
|
182
216
|
}
|
|
183
217
|
interface ImportDatasetResult {
|
|
184
218
|
columns: ImportedColumn[];
|
|
@@ -189,4 +223,4 @@ interface ImportDatasetResult {
|
|
|
189
223
|
meta: ImportMeta;
|
|
190
224
|
}
|
|
191
225
|
declare function importDataset(input: string | BinaryInput, options?: ImportDatasetOptions): Promise<ImportDatasetResult>;
|
|
192
|
-
export {
|
|
226
|
+
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 };
|
|
@@ -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,12 @@ 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` (docs/api.md §5.6, "Type rules").
|
|
54
|
+
*/
|
|
55
|
+
type ColumnType = "string" | "number" | "boolean" | "date" | "datetime" | "day" | "mixed" | "empty";
|
|
39
56
|
interface DatasetLike {
|
|
40
57
|
columns: ReadonlyArray<{
|
|
41
58
|
key: string;
|
|
@@ -152,7 +169,17 @@ interface ImportDatasetOptions {
|
|
|
152
169
|
mapping?: ColumnMapping | undefined;
|
|
153
170
|
maxRows?: number | undefined;
|
|
154
171
|
preview?: number | undefined;
|
|
155
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* Issues kept in `issues` (added in 2.3). Past it, an issue is counted in `meta.droppedIssues`
|
|
174
|
+
* instead, unless it is the first of its code, so every kind of issue that occurred is listed at
|
|
175
|
+
* least once (and so is an `error` severity, if any). An integer of at least 1, or `Infinity` for no
|
|
176
|
+
* cap; default 100,000.
|
|
177
|
+
*/
|
|
178
|
+
maxIssues?: number | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Reader limits for xlsx. For a CSV file, `maxWarnings` caps its warnings and
|
|
181
|
+
* `maxCellTextLength` limits its fields (raising CSV's 1 MiB `maxFieldBytes` to match).
|
|
182
|
+
*/
|
|
156
183
|
limits?: Partial<ReadLimits> | undefined;
|
|
157
184
|
signal?: AbortSignalLike | undefined;
|
|
158
185
|
onProgress?: ((p: ImportProgress) => void) | undefined;
|
|
@@ -179,6 +206,13 @@ interface ImportMeta {
|
|
|
179
206
|
truncated: boolean;
|
|
180
207
|
mapping?: ColumnMapping | undefined;
|
|
181
208
|
unmappedColumns?: string[] | undefined;
|
|
209
|
+
/** Set only when `maxIssues` dropped issues: how many, by code (added in 2.3). */
|
|
210
|
+
droppedIssues?: DroppedIssues | undefined;
|
|
211
|
+
}
|
|
212
|
+
/** Issues `maxIssues` kept out of `ImportDatasetResult.issues`. */
|
|
213
|
+
interface DroppedIssues {
|
|
214
|
+
total: number;
|
|
215
|
+
byCode: Partial<Record<ImportIssueCode, number>>;
|
|
182
216
|
}
|
|
183
217
|
interface ImportDatasetResult {
|
|
184
218
|
columns: ImportedColumn[];
|
|
@@ -189,4 +223,4 @@ interface ImportDatasetResult {
|
|
|
189
223
|
meta: ImportMeta;
|
|
190
224
|
}
|
|
191
225
|
declare function importDataset(input: string | BinaryInput, options?: ImportDatasetOptions): Promise<ImportDatasetResult>;
|
|
192
|
-
export {
|
|
226
|
+
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 };
|