@shbernal/ts-xlsx 1.3.1 → 2.1.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 +20 -10
- package/dist/bytes.d.ts +24 -0
- package/dist/bytes.js +34 -0
- package/dist/core/address.d.ts +72 -3
- package/dist/core/address.js +50 -10
- package/dist/core/autofilter.d.ts +13 -2
- package/dist/core/autofilter.js +35 -10
- package/dist/core/cell.d.ts +17 -16
- package/dist/core/cell.js +3 -7
- package/dist/core/color-resolution.d.ts +8 -8
- package/dist/core/color-resolution.js +7 -8
- package/dist/core/column.d.ts +8 -9
- package/dist/core/column.js +2 -4
- package/dist/core/comment-thread.d.ts +32 -23
- package/dist/core/comment-thread.js +4 -4
- package/dist/core/conditional-formatting-overlay.d.ts +6 -1
- package/dist/core/conditional-formatting-overlay.js +11 -0
- package/dist/core/conditional-formatting.d.ts +48 -8
- package/dist/core/conditional-formatting.js +88 -0
- package/dist/core/data-validation-overlay.d.ts +12 -1
- package/dist/core/data-validation-overlay.js +21 -2
- package/dist/core/data-validation.d.ts +12 -5
- package/dist/core/data-validation.js +34 -0
- package/dist/core/date.d.ts +3 -3
- package/dist/core/formula.d.ts +6 -6
- package/dist/core/grid-edits.d.ts +16 -0
- package/dist/core/grid-edits.js +29 -11
- package/dist/core/grid-shift.d.ts +19 -0
- package/dist/core/grid-shift.js +8 -0
- package/dist/core/image.d.ts +39 -2
- package/dist/core/image.js +10 -0
- package/dist/core/internal.d.ts +9 -1
- package/dist/core/limits.d.ts +4 -4
- package/dist/core/merge.d.ts +17 -12
- package/dist/core/merge.js +36 -5
- package/dist/core/page-setup.d.ts +20 -6
- package/dist/core/page-setup.js +8 -1
- package/dist/core/pivot-table.d.ts +4 -4
- package/dist/core/pivot-table.js +29 -20
- package/dist/core/preserved.d.ts +3 -3
- package/dist/core/protection.d.ts +7 -4
- package/dist/core/protection.js +20 -14
- package/dist/core/range.d.ts +16 -14
- package/dist/core/range.js +5 -5
- package/dist/core/row-input.d.ts +9 -8
- package/dist/core/row-input.js +12 -10
- package/dist/core/row.d.ts +7 -8
- package/dist/core/row.js +2 -4
- package/dist/core/style.d.ts +41 -14
- package/dist/core/style.js +82 -67
- package/dist/core/table-style.d.ts +9 -9
- package/dist/core/table-style.js +1 -1
- package/dist/core/table.d.ts +53 -51
- package/dist/core/table.js +83 -41
- package/dist/core/theme.d.ts +16 -44
- package/dist/core/theme.js +6 -148
- package/dist/core/value.d.ts +7 -7
- package/dist/core/workbook-protection.d.ts +2 -2
- package/dist/core/workbook-styles.d.ts +26 -0
- package/dist/core/workbook-styles.js +48 -0
- package/dist/core/workbook-theme.d.ts +25 -0
- package/dist/core/workbook-theme.js +49 -0
- package/dist/core/workbook-vba.d.ts +17 -0
- package/dist/core/workbook-vba.js +79 -0
- package/dist/core/workbook.d.ts +133 -87
- package/dist/core/workbook.js +74 -133
- package/dist/core/worksheet-comments.d.ts +17 -0
- package/dist/core/worksheet-comments.js +70 -0
- package/dist/core/worksheet-model.d.ts +4 -4
- package/dist/core/worksheet-model.js +1 -0
- package/dist/core/worksheet-pictures.d.ts +29 -0
- package/dist/core/worksheet-pictures.js +42 -0
- package/dist/core/worksheet.d.ts +100 -79
- package/dist/core/worksheet.js +63 -142
- package/dist/customui/errors.d.ts +1 -1
- package/dist/customui/ribbon.d.ts +3 -3
- package/dist/customui/ribbon.js +24 -23
- package/dist/entries/core.d.ts +7 -7
- package/dist/entries/core.js +1 -1
- package/dist/entries/csv.d.ts +1 -1
- package/dist/entries/node-unavailable.d.ts +15 -0
- package/dist/entries/node-unavailable.js +20 -0
- package/dist/entries/node.d.ts +1 -0
- package/dist/entries/node.js +1 -0
- package/dist/entries/vba.d.ts +1 -1
- package/dist/entries/vba.js +1 -1
- package/dist/entries/xlsx.d.ts +1 -1
- package/dist/entries/xlsx.js +1 -1
- package/dist/errors.d.ts +12 -12
- package/dist/io/csv/read.js +2 -3
- package/dist/io/csv/write.d.ts +19 -4
- package/dist/io/csv/write.js +34 -4
- package/dist/io/opc/errors.d.ts +6 -6
- package/dist/io/opc/inflate.d.ts +1 -1
- package/dist/io/opc/inflate.js +2 -12
- package/dist/io/opc/namespaces.d.ts +1 -1
- package/dist/io/opc/read-opc.d.ts +19 -3
- package/dist/io/opc/read-opc.js +14 -8
- package/dist/io/opc/read-options.d.ts +2 -2
- package/dist/io/opc/rels.d.ts +11 -0
- package/dist/io/opc/rels.js +3 -2
- package/dist/io/opc/sniff-format.d.ts +2 -2
- package/dist/io/style/xf-style.d.ts +44 -7
- package/dist/io/style/xf-style.js +27 -0
- package/dist/io/xlsb/errors.d.ts +1 -1
- package/dist/io/xlsb/formula.d.ts +4 -4
- package/dist/io/xlsb/primitives.d.ts +8 -8
- package/dist/io/xlsb/ptg-functions.d.ts +1 -1
- package/dist/io/xlsb/read-styles.js +2 -20
- package/dist/io/xlsb/read.d.ts +2 -2
- package/dist/io/xlsx/cell-accumulator.d.ts +26 -9
- package/dist/io/xlsx/cell-accumulator.js +89 -46
- package/dist/io/xlsx/cell-value.d.ts +3 -3
- package/dist/io/xlsx/cell-value.js +9 -6
- package/dist/io/xlsx/color-xml.d.ts +1 -1
- package/dist/io/xlsx/color-xml.js +18 -23
- package/dist/io/xlsx/comments.d.ts +5 -5
- package/dist/io/xlsx/comments.js +17 -8
- package/dist/io/xlsx/conditional-formatting.d.ts +4 -4
- package/dist/io/xlsx/conditional-formatting.js +64 -58
- package/dist/io/xlsx/data-validation.d.ts +3 -3
- package/dist/io/xlsx/data-validation.js +35 -33
- package/dist/io/xlsx/errors.d.ts +3 -3
- package/dist/io/xlsx/hyperlinks.d.ts +4 -2
- package/dist/io/xlsx/hyperlinks.js +10 -18
- package/dist/io/xlsx/images.d.ts +1 -1
- package/dist/io/xlsx/images.js +25 -28
- package/dist/io/xlsx/namespaces.d.ts +2 -2
- package/dist/io/xlsx/package-plan.js +5 -2
- package/dist/io/xlsx/read-pivot.js +4 -13
- package/dist/io/xlsx/read-rows.d.ts +13 -13
- package/dist/io/xlsx/read-rows.js +19 -55
- package/dist/io/xlsx/read-shared-strings.js +7 -44
- package/dist/io/xlsx/read-styles.d.ts +3 -3
- package/dist/io/xlsx/read-styles.js +42 -66
- package/dist/io/xlsx/read-worksheet.js +73 -129
- package/dist/io/xlsx/read.d.ts +4 -6
- package/dist/io/xlsx/read.js +104 -142
- package/dist/io/xlsx/rich-runs.d.ts +41 -7
- package/dist/io/xlsx/rich-runs.js +94 -30
- package/dist/io/xlsx/rich-text.d.ts +1 -1
- package/dist/io/xlsx/shared-strings.d.ts +2 -2
- package/dist/io/xlsx/sheet-properties.d.ts +1 -1
- package/dist/io/xlsx/sheet-properties.js +14 -10
- package/dist/io/xlsx/styles.d.ts +9 -22
- package/dist/io/xlsx/styles.js +65 -89
- package/dist/io/xlsx/tables.d.ts +2 -2
- package/dist/io/xlsx/tables.js +20 -25
- package/dist/io/xlsx/theme-xml.d.ts +37 -0
- package/dist/io/xlsx/theme-xml.js +145 -0
- package/dist/io/xlsx/threaded-comments.d.ts +18 -27
- package/dist/io/xlsx/threaded-comments.js +26 -38
- package/dist/io/xlsx/workbook-xml.js +14 -8
- package/dist/io/xlsx/worksheet-xml.d.ts +2 -2
- package/dist/io/xlsx/worksheet-xml.js +40 -48
- package/dist/io/xlsx/write-stream.d.ts +23 -16
- package/dist/io/xlsx/write-stream.js +13 -14
- package/dist/io/xlsx/write.d.ts +8 -7
- package/dist/io/xlsx/write.js +6 -3
- package/dist/io/xlsx/x14-ext.d.ts +1 -1
- package/dist/sha512.d.ts +2 -0
- package/dist/sha512.js +146 -0
- package/dist/vba/bytes.d.ts +11 -0
- package/dist/vba/bytes.js +29 -0
- package/dist/vba/cfb-writer.d.ts +1 -1
- package/dist/vba/cfb.d.ts +1 -1
- package/dist/vba/cfb.js +15 -51
- package/dist/vba/codepage.d.ts +2 -2
- package/dist/vba/dir-records.d.ts +53 -0
- package/dist/vba/dir-records.js +28 -0
- package/dist/vba/errors.d.ts +2 -2
- package/dist/vba/index.d.ts +2 -2
- package/dist/vba/index.js +2 -2
- package/dist/vba/ms-ovba.d.ts +1 -1
- package/dist/vba/ms-ovba.js +1 -3
- package/dist/vba/project-editor.d.ts +9 -9
- package/dist/vba/project-editor.js +6 -44
- package/dist/vba/project.d.ts +5 -5
- package/dist/vba/project.js +3 -28
- package/dist/vba/vba-encoding.d.ts +1 -1
- package/dist/xml/errors.d.ts +1 -1
- package/dist/xml/xml-read.d.ts +98 -9
- package/dist/xml/xml-read.js +70 -0
- package/dist/xml/xml.d.ts +74 -10
- package/dist/xml/xml.js +39 -7
- package/package.json +59 -36
package/dist/xml/xml.d.ts
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refuse a string that XML cannot carry, naming the character and where it is so the author
|
|
3
|
+
* can find it in a value they never inspected. These arrive from a database column or a CSV
|
|
4
|
+
* field, not from a literal in the calling code.
|
|
5
|
+
*
|
|
6
|
+
* Exported for the one escape that cannot be {@link escapeAttr}: a number format code escapes
|
|
7
|
+
* everything but the apostrophe, and needs this guard just the same.
|
|
8
|
+
*
|
|
9
|
+
* @throws {AuthoringError} naming the code point and its offset.
|
|
10
|
+
*/
|
|
11
|
+
export declare function assertRepresentable(value: string): void;
|
|
1
12
|
/** Escape a string for use as XML element text. */
|
|
2
13
|
export declare function escapeText(value: string): string;
|
|
3
14
|
/** Escape a string for use inside a double-quoted XML attribute value. */
|
|
4
15
|
export declare function escapeAttr(value: string): string;
|
|
5
16
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
17
|
+
* Escape a cell value: the `_xHHHH_` convention first, then XML's own escapes.
|
|
18
|
+
*
|
|
19
|
+
* The order of the two replacements is load-bearing. Once `_xHHHH_` decodes to something, a
|
|
20
|
+
* value that legitimately reads `_x0041_` would come back as `A`, so the underscore is
|
|
21
|
+
* escaped first, and only where it begins a sequence that would otherwise decode, leaving
|
|
22
|
+
* every other underscore alone. Doing that after the character escape would re-escape the
|
|
23
|
+
* `_x005F_` it had just introduced.
|
|
24
|
+
*
|
|
25
|
+
* `escapeText` runs last and sees no unrepresentable character left, so its guard is a
|
|
26
|
+
* standing proof that the escape was complete rather than a second check of the same thing.
|
|
27
|
+
*
|
|
28
|
+
* Reversed by `decodeSpreadsheetText` in `./xml-read.ts`, whose single left-to-right pass is what
|
|
29
|
+
* makes the `_x005F_` step above reversible. Change either and read its comment first.
|
|
9
30
|
*/
|
|
10
|
-
export declare function
|
|
31
|
+
export declare function escapeSpreadsheetText(value: string): string;
|
|
11
32
|
/**
|
|
12
33
|
* A `<t>` text element carrying an escaped string, marked `xml:space="preserve"` when its
|
|
13
|
-
* whitespace would otherwise be collapsed. Shared by every string-bearing element
|
|
14
|
-
* inline string cell, a rich-text run
|
|
34
|
+
* whitespace would otherwise be collapsed. Shared by every string-bearing element (a plain
|
|
35
|
+
* inline string cell, a rich-text run, a pooled string, a note's body) so all decode
|
|
36
|
+
* identically on the way back.
|
|
15
37
|
*/
|
|
16
38
|
export declare function textElement(value: string): string;
|
|
17
39
|
/**
|
|
18
40
|
* Render a formula operand for serialisation: a number becomes its literal, a string is stripped of
|
|
19
41
|
* the single optional leading '=' an author may write (OOXML stores the expression without it, e.g.
|
|
20
|
-
* `=A1>0` on disk is `A1>0`). The result is unescaped
|
|
42
|
+
* `=A1>0` on disk is `A1>0`). The result is unescaped: the caller escapes it for its target,
|
|
21
43
|
* whether that is element text or an attribute value.
|
|
22
44
|
*/
|
|
23
45
|
export declare function stripFormulaEquals(value: string | number): string;
|
|
@@ -25,14 +47,56 @@ export declare function stripFormulaEquals(value: string | number): string;
|
|
|
25
47
|
* A boolean attribute rendered with a leading space (` name="1"` / ` name="0"`), or '' when the value
|
|
26
48
|
* is undefined. OOXML booleans serialise as 1/0; emitting the explicit `="0"` lets a writer force a
|
|
27
49
|
* flag off against a consumer's default, while an unset (undefined) flag stays out of the element
|
|
28
|
-
* entirely
|
|
50
|
+
* entirely: the two-state-plus-absent contract every flag writer here shares.
|
|
29
51
|
*/
|
|
30
52
|
export declare function boolAttr(name: string, value: boolean | undefined): string;
|
|
53
|
+
/**
|
|
54
|
+
* A free-string attribute rendered with a leading space (` name="a & b"`), or '' when the value
|
|
55
|
+
* is undefined. The third of the trio with {@link boolAttr} and {@link numAttr}: the value is prose
|
|
56
|
+
* the caller chose, so it is escaped rather than checked.
|
|
57
|
+
*
|
|
58
|
+
* A token from a closed OOXML enumeration is the other case and goes through {@link checkedToken}
|
|
59
|
+
* instead. Escaping a bogus token would produce a well-formed document that Excel still rejects,
|
|
60
|
+
* which hides the mistake in the file rather than raising it at the call.
|
|
61
|
+
*/
|
|
62
|
+
export declare function textAttr(name: string, value: string | undefined): string;
|
|
63
|
+
/**
|
|
64
|
+
* Refuse a token from a closed OOXML enumeration that the writer would otherwise emit verbatim, and
|
|
65
|
+
* return it unchanged when it belongs. The public types already forbid an out-of-contract value, so
|
|
66
|
+
* this fires only for one smuggled past them by an untyped caller, a `JSON.parse`, or a cast.
|
|
67
|
+
*
|
|
68
|
+
* The writer must never serialise such a value: it would be schema-invalid OOXML that Excel
|
|
69
|
+
* sometimes tolerates yet the library's own reader, which narrows every such token through the same
|
|
70
|
+
* guard, discards on read-back. Refusing at the write boundary keeps the two symmetric, garbage out
|
|
71
|
+
* refused exactly as garbage in, so a value the writer accepts is always one that round-trips.
|
|
72
|
+
*
|
|
73
|
+
* @throws {AuthoringError} naming the value and the enumeration.
|
|
74
|
+
*/
|
|
75
|
+
export declare function checkedToken(value: string, isValid: (candidate: string) => boolean, kind: string): string;
|
|
31
76
|
/**
|
|
32
77
|
* A numeric attribute rendered with a leading space (` name="42"`), or '' when the value is undefined
|
|
33
|
-
*
|
|
78
|
+
* so that a count an author never set stays out of the element rather than fabricating a default.
|
|
79
|
+
*
|
|
80
|
+
* The value goes through {@link numberText}, so a non-finite one is refused here rather than written
|
|
81
|
+
* as `NaN`. Every attribute on this path is `xsd:double` or `xsd:unsignedInt`, neither of which has a
|
|
82
|
+
* spelling for it, so the alternative is a package Excel reports as damaged.
|
|
83
|
+
*
|
|
84
|
+
* @throws {AuthoringError} when the value is not finite.
|
|
85
|
+
*/
|
|
86
|
+
export declare function numAttr(name: string, value: number | undefined): string;
|
|
87
|
+
/**
|
|
88
|
+
* Refuse a number OOXML cannot spell. Every numeric attribute in the format is `xsd:double`,
|
|
89
|
+
* `xsd:unsignedInt` or a bounded flavour of one, and none of those lexical spaces has a form for a
|
|
90
|
+
* NaN or an infinity, so a value that reaches the file as `NaN` is a package Excel reports as
|
|
91
|
+
* damaged.
|
|
92
|
+
*
|
|
93
|
+
* Exported for the callers that must refuse before they write. A number can be unwritable and still
|
|
94
|
+
* be read on the way to the bytes: compared, summed, walked. A comparison against `NaN` or an
|
|
95
|
+
* infinity silently takes the wrong branch long before the value would have been serialised.
|
|
96
|
+
*
|
|
97
|
+
* @throws {AuthoringError} naming the value.
|
|
34
98
|
*/
|
|
35
|
-
export declare function
|
|
99
|
+
export declare function assertWritableNumber(value: number): void;
|
|
36
100
|
/**
|
|
37
101
|
* A finite number serialises as its shortest round-trippable decimal; a non-finite one
|
|
38
102
|
* has no OOXML numeric representation, so the writer refuses it rather than emit `NaN`.
|
package/dist/xml/xml.js
CHANGED
|
@@ -14,18 +14,38 @@ const ATTR_ESCAPES = {
|
|
|
14
14
|
'\r': ' ',
|
|
15
15
|
'\t': '	',
|
|
16
16
|
};
|
|
17
|
+
const UNREPRESENTABLE = /[\u{0}-\u{8}\u{B}\u{C}\u{E}-\u{1F}\u{FFFE}\u{FFFF}\u{D800}-\u{DFFF}]/u;
|
|
18
|
+
const UNREPRESENTABLE_GLOBAL = new RegExp(UNREPRESENTABLE.source, 'gu');
|
|
19
|
+
function codePointHex(codePoint) {
|
|
20
|
+
return codePoint.toString(16).toUpperCase().padStart(4, '0');
|
|
21
|
+
}
|
|
22
|
+
export function assertRepresentable(value) {
|
|
23
|
+
const found = UNREPRESENTABLE.exec(value);
|
|
24
|
+
if (found === null)
|
|
25
|
+
return;
|
|
26
|
+
throw new AuthoringError(`cannot write U+${codePointHex(value.codePointAt(found.index))} at offset ${found.index}: ` +
|
|
27
|
+
'XML 1.0 has no representation for it, and the _xHHHH_ escape that would carry it is a ' +
|
|
28
|
+
'convention of cell values only');
|
|
29
|
+
}
|
|
17
30
|
export function escapeText(value) {
|
|
31
|
+
assertRepresentable(value);
|
|
18
32
|
return value.replace(/[&<>]/g, (ch) => TEXT_ESCAPES[ch]);
|
|
19
33
|
}
|
|
20
34
|
export function escapeAttr(value) {
|
|
35
|
+
assertRepresentable(value);
|
|
21
36
|
return value.replace(/[&<>"'\n\r\t]/g, (ch) => ATTR_ESCAPES[ch]);
|
|
22
37
|
}
|
|
23
|
-
export function
|
|
38
|
+
export function escapeSpreadsheetText(value) {
|
|
39
|
+
return escapeText(value
|
|
40
|
+
.replace(/_(x[0-9A-Fa-f]{4}_)/g, '_x005F_$1')
|
|
41
|
+
.replace(UNREPRESENTABLE_GLOBAL, (ch) => `_x${codePointHex(ch.codePointAt(0))}_`));
|
|
42
|
+
}
|
|
43
|
+
function needsSpacePreserve(value) {
|
|
24
44
|
return value.length > 0 && (value !== value.trim() || /[\n\r\t]/.test(value));
|
|
25
45
|
}
|
|
26
46
|
export function textElement(value) {
|
|
27
47
|
const space = needsSpacePreserve(value) ? ' xml:space="preserve"' : '';
|
|
28
|
-
return `<t${space}>${
|
|
48
|
+
return `<t${space}>${escapeSpreadsheetText(value)}</t>`;
|
|
29
49
|
}
|
|
30
50
|
export function stripFormulaEquals(value) {
|
|
31
51
|
if (typeof value === 'number')
|
|
@@ -35,13 +55,25 @@ export function stripFormulaEquals(value) {
|
|
|
35
55
|
export function boolAttr(name, value) {
|
|
36
56
|
return value === undefined ? '' : ` ${name}="${value ? 1 : 0}"`;
|
|
37
57
|
}
|
|
38
|
-
export function
|
|
39
|
-
return value === undefined ? '' : ` ${name}="${value}"`;
|
|
58
|
+
export function textAttr(name, value) {
|
|
59
|
+
return value === undefined ? '' : ` ${name}="${escapeAttr(value)}"`;
|
|
40
60
|
}
|
|
41
|
-
export function
|
|
42
|
-
if (!
|
|
43
|
-
throw new AuthoringError(`
|
|
61
|
+
export function checkedToken(value, isValid, kind) {
|
|
62
|
+
if (!isValid(value)) {
|
|
63
|
+
throw new AuthoringError(`Invalid ${kind} ${JSON.stringify(value)}: not a value the OOXML enumeration allows`);
|
|
44
64
|
}
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
export function numAttr(name, value) {
|
|
68
|
+
return value === undefined ? '' : ` ${name}="${numberText(value)}"`;
|
|
69
|
+
}
|
|
70
|
+
export function assertWritableNumber(value) {
|
|
71
|
+
if (Number.isFinite(value))
|
|
72
|
+
return;
|
|
73
|
+
throw new AuthoringError(`cannot write a non-finite number (${value}): it has no OOXML representation`);
|
|
74
|
+
}
|
|
75
|
+
export function numberText(value) {
|
|
76
|
+
assertWritableNumber(value);
|
|
45
77
|
return String(value);
|
|
46
78
|
}
|
|
47
79
|
export const XML_DECLARATION = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
package/package.json
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shbernal/ts-xlsx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A TypeScript-first library for reading and writing xlsx (OOXML) spreadsheets.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"csv",
|
|
7
|
+
"excel",
|
|
8
|
+
"ooxml",
|
|
9
|
+
"spreadsheet",
|
|
10
|
+
"streaming",
|
|
11
|
+
"typescript",
|
|
12
|
+
"workbook",
|
|
13
|
+
"xlsx"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://shbernal.github.io/ts-xlsx/",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/shbernal/ts-xlsx/issues"
|
|
18
|
+
},
|
|
5
19
|
"license": "MIT",
|
|
6
20
|
"author": "shbernal",
|
|
7
|
-
"type": "module",
|
|
8
21
|
"repository": {
|
|
9
22
|
"type": "git",
|
|
10
23
|
"url": "https://github.com/shbernal/ts-xlsx.git"
|
|
11
24
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"packageManager": "pnpm@11.11.0",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"skills",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
20
32
|
"sideEffects": false,
|
|
33
|
+
"main": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
21
35
|
"exports": {
|
|
22
36
|
".": {
|
|
23
37
|
"types": "./dist/index.d.ts",
|
|
@@ -47,71 +61,80 @@
|
|
|
47
61
|
"types": "./dist/entries/customui.d.ts",
|
|
48
62
|
"default": "./dist/entries/customui.js"
|
|
49
63
|
},
|
|
64
|
+
"./node": {
|
|
65
|
+
"types": "./dist/entries/node.d.ts",
|
|
66
|
+
"browser": "./dist/entries/node-unavailable.js",
|
|
67
|
+
"default": "./dist/entries/node.js"
|
|
68
|
+
},
|
|
50
69
|
"./errors": {
|
|
51
70
|
"types": "./dist/entries/errors.d.ts",
|
|
52
71
|
"default": "./dist/entries/errors.js"
|
|
53
72
|
},
|
|
54
73
|
"./package.json": "./package.json"
|
|
55
74
|
},
|
|
56
|
-
"main": "./dist/index.js",
|
|
57
|
-
"types": "./dist/index.d.ts",
|
|
58
75
|
"publishConfig": {
|
|
59
76
|
"access": "public"
|
|
60
77
|
},
|
|
61
|
-
"files": [
|
|
62
|
-
"dist",
|
|
63
|
-
"skills",
|
|
64
|
-
"LICENSE",
|
|
65
|
-
"README.md"
|
|
66
|
-
],
|
|
67
78
|
"scripts": {
|
|
68
79
|
"prepare": "node scripts/install-hooks.ts",
|
|
69
80
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
70
81
|
"build": "pnpm run clean && tsc -p tsconfig.build.json && tsc -p tsconfig.build.dts.json",
|
|
71
82
|
"size": "node scripts/size-budget.ts",
|
|
72
83
|
"smoke:dist": "node scripts/smoke-dist.ts",
|
|
84
|
+
"site:prepare": "node www/scripts/sync-docs.ts",
|
|
85
|
+
"site:check": "node www/scripts/check.ts",
|
|
86
|
+
"samples:check": "node www/scripts/check-samples.ts",
|
|
87
|
+
"site:dev": "pnpm run site:prepare && vitepress dev www",
|
|
88
|
+
"site:build": "pnpm run site:prepare && vitepress build www && node www/scripts/check-built-links.ts",
|
|
89
|
+
"site:preview": "vitepress preview www",
|
|
73
90
|
"docs": "node scripts/gen-docs.ts",
|
|
74
91
|
"docs:check": "node scripts/gen-docs.ts && git add --intent-to-add -- docs/api && git diff --exit-code -- docs/api",
|
|
75
92
|
"constitution:check": "node scripts/check-constitution.ts",
|
|
76
93
|
"layering:check": "node scripts/check-layering.ts",
|
|
77
94
|
"entries:check": "node scripts/check-entries.ts",
|
|
95
|
+
"browser:check": "node scripts/check-browser-safe.ts",
|
|
78
96
|
"source-text:check": "node scripts/check-source-text.ts",
|
|
79
|
-
"
|
|
80
|
-
"lint
|
|
81
|
-
"
|
|
97
|
+
"chars:check": "charcheck",
|
|
98
|
+
"lint": "node node_modules/oxlint/bin/oxlint src scripts test tools www charcheck.config.ts --type-aware --deny-warnings --report-unused-disable-directives",
|
|
99
|
+
"lint:fix": "pnpm run lint --fix",
|
|
100
|
+
"format": "node scripts/format.ts --write",
|
|
101
|
+
"format:check": "node scripts/format.ts --check",
|
|
82
102
|
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json",
|
|
83
103
|
"typecheck:src": "tsc --noEmit -p tsconfig.json",
|
|
84
104
|
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
|
|
85
105
|
"typecheck:dist": "tsc --noEmit -p tsconfig.dist.json",
|
|
106
|
+
"typecheck:site": "tsc --noEmit -p www/tsconfig.json",
|
|
86
107
|
"test:src": "node --test \"src/**/*.test.ts\"",
|
|
87
|
-
"test:
|
|
108
|
+
"test:site": "node --test \"www/**/*.test.ts\"",
|
|
109
|
+
"coverage": "node scripts/coverage.ts",
|
|
88
110
|
"corpus": "node test/corpus/run.ts",
|
|
89
111
|
"corpus:dist": "node test/corpus/run.ts --target dist",
|
|
90
112
|
"verify": "node scripts/verify.ts --full",
|
|
91
113
|
"verify:quick": "node scripts/verify.ts --quick",
|
|
92
114
|
"test": "node scripts/verify.ts --full",
|
|
93
115
|
"prepublishOnly": "pnpm run build && pnpm run test && pnpm run smoke:dist && pnpm run size",
|
|
94
|
-
"validate:ooxml": "
|
|
116
|
+
"validate:ooxml": "ooxml-validate",
|
|
95
117
|
"test:ooxml": "node test/ooxml-validation/run.ts"
|
|
96
118
|
},
|
|
97
|
-
"keywords": [
|
|
98
|
-
"xlsx",
|
|
99
|
-
"ooxml",
|
|
100
|
-
"excel",
|
|
101
|
-
"spreadsheet",
|
|
102
|
-
"csv",
|
|
103
|
-
"typescript",
|
|
104
|
-
"workbook",
|
|
105
|
-
"streaming"
|
|
106
|
-
],
|
|
107
119
|
"dependencies": {
|
|
108
120
|
"fflate": "^0.8.3"
|
|
109
121
|
},
|
|
110
122
|
"devDependencies": {
|
|
111
|
-
"@biomejs/biome": "2.5.7",
|
|
112
123
|
"@types/node": "^24.13.3",
|
|
124
|
+
"charcheck": "^0.3.0",
|
|
113
125
|
"jszip": "^3.10.1",
|
|
114
126
|
"lefthook": "^2.1.10",
|
|
115
|
-
"
|
|
116
|
-
|
|
127
|
+
"ooxml-validate": "^0.0.3",
|
|
128
|
+
"oxfmt": "^0.64.0",
|
|
129
|
+
"oxlint": "^1.80.0",
|
|
130
|
+
"oxlint-tsgolint": "7.0.2001",
|
|
131
|
+
"shiki": "^4.4.3",
|
|
132
|
+
"typescript": "^7.0.2",
|
|
133
|
+
"vitepress": "^1.6.4",
|
|
134
|
+
"vue": "^3.5.41"
|
|
135
|
+
},
|
|
136
|
+
"engines": {
|
|
137
|
+
"node": ">=24"
|
|
138
|
+
},
|
|
139
|
+
"packageManager": "pnpm@11.11.0"
|
|
117
140
|
}
|