@cj-tech-master/excelts 1.4.4 → 1.4.5

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.
@@ -143,7 +143,7 @@ class Column {
143
143
  const colNumber = this.number;
144
144
  if (!iteratee) {
145
145
  iteratee = options;
146
- options = null;
146
+ options = {};
147
147
  }
148
148
  this._worksheet.eachRow(options, (row, rowNumber) => {
149
149
  iteratee(row.getCell(colNumber), rowNumber);
@@ -115,10 +115,15 @@ class Row {
115
115
  cDst._comment = undefined;
116
116
  }
117
117
  }
118
- eachCell(options, iteratee) {
119
- if (!iteratee) {
120
- iteratee = options;
121
- options = null;
118
+ eachCell(optionsOrIteratee, maybeIteratee) {
119
+ let options = null;
120
+ let iteratee;
121
+ if (typeof optionsOrIteratee === "function") {
122
+ iteratee = optionsOrIteratee;
123
+ }
124
+ else {
125
+ options = optionsOrIteratee;
126
+ iteratee = maybeIteratee;
122
127
  }
123
128
  if (options && options.includeEmpty) {
124
129
  const n = this._cells.length;
@@ -473,10 +473,15 @@ class Worksheet {
473
473
  // account for defined names
474
474
  this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
475
475
  }
476
- eachRow(options, iteratee) {
477
- if (!iteratee) {
478
- iteratee = options;
479
- options = undefined;
476
+ eachRow(optionsOrIteratee, maybeIteratee) {
477
+ let options;
478
+ let iteratee;
479
+ if (typeof optionsOrIteratee === "function") {
480
+ iteratee = optionsOrIteratee;
481
+ }
482
+ else {
483
+ options = optionsOrIteratee;
484
+ iteratee = maybeIteratee;
480
485
  }
481
486
  if (options && options.includeEmpty) {
482
487
  const n = this._rows.length;
@@ -140,7 +140,7 @@ class Column {
140
140
  const colNumber = this.number;
141
141
  if (!iteratee) {
142
142
  iteratee = options;
143
- options = null;
143
+ options = {};
144
144
  }
145
145
  this._worksheet.eachRow(options, (row, rowNumber) => {
146
146
  iteratee(row.getCell(colNumber), rowNumber);
@@ -112,10 +112,15 @@ class Row {
112
112
  cDst._comment = undefined;
113
113
  }
114
114
  }
115
- eachCell(options, iteratee) {
116
- if (!iteratee) {
117
- iteratee = options;
118
- options = null;
115
+ eachCell(optionsOrIteratee, maybeIteratee) {
116
+ let options = null;
117
+ let iteratee;
118
+ if (typeof optionsOrIteratee === "function") {
119
+ iteratee = optionsOrIteratee;
120
+ }
121
+ else {
122
+ options = optionsOrIteratee;
123
+ iteratee = maybeIteratee;
119
124
  }
120
125
  if (options && options.includeEmpty) {
121
126
  const n = this._cells.length;
@@ -470,10 +470,15 @@ class Worksheet {
470
470
  // account for defined names
471
471
  this.workbook.definedNames.spliceRows(this.name, start, count, nInserts);
472
472
  }
473
- eachRow(options, iteratee) {
474
- if (!iteratee) {
475
- iteratee = options;
476
- options = undefined;
473
+ eachRow(optionsOrIteratee, maybeIteratee) {
474
+ let options;
475
+ let iteratee;
476
+ if (typeof optionsOrIteratee === "function") {
477
+ iteratee = optionsOrIteratee;
478
+ }
479
+ else {
480
+ options = optionsOrIteratee;
481
+ iteratee = maybeIteratee;
477
482
  }
478
483
  if (options && options.includeEmpty) {
479
484
  const n = this._rows.length;
@@ -1,3 +1,7 @@
1
+ import type { Row } from "./row.js";
2
+ import type { Column } from "./column.js";
3
+ import type { Worksheet } from "./worksheet.js";
4
+ import type { Workbook } from "./workbook.js";
1
5
  interface FullAddress {
2
6
  sheetName: string;
3
7
  address: string;
@@ -26,16 +30,16 @@ interface CellModel {
26
30
  }
27
31
  declare class Cell {
28
32
  static Types: typeof import("./enums.js").ValueType;
29
- _row: any;
30
- _column: any;
33
+ _row: Row;
34
+ _column: Column;
31
35
  _address: string;
32
36
  _value: any;
33
- style: any;
37
+ style: Record<string, unknown>;
34
38
  _mergeCount: number;
35
39
  _comment?: any;
36
- constructor(row: any, column: any, address: string);
37
- get worksheet(): any;
38
- get workbook(): any;
40
+ constructor(row: Row, column: Column, address: string);
41
+ get worksheet(): Worksheet;
42
+ get workbook(): Workbook;
39
43
  destroy(): void;
40
44
  get numFmt(): any;
41
45
  set numFmt(value: any);
@@ -1,3 +1,5 @@
1
+ import type { Cell } from "./cell.js";
2
+ import type { Worksheet } from "./worksheet.js";
1
3
  interface ColumnDefn {
2
4
  header?: any;
3
5
  key?: string;
@@ -17,14 +19,14 @@ interface ColumnModel {
17
19
  collapsed?: boolean;
18
20
  }
19
21
  declare class Column {
20
- _worksheet: any;
22
+ _worksheet: Worksheet;
21
23
  _number: number;
22
- _header: any;
24
+ _header: string | string[] | undefined;
23
25
  _key: string | undefined;
24
26
  width?: number;
25
27
  _hidden: boolean | undefined;
26
28
  _outlineLevel: number | undefined;
27
- style: any;
29
+ style: Record<string, unknown>;
28
30
  constructor(worksheet: any, number: number, defn?: any);
29
31
  get number(): number;
30
32
  get worksheet(): any;
@@ -46,7 +48,9 @@ declare class Column {
46
48
  equivalentTo(other: Column): boolean;
47
49
  get isDefault(): boolean;
48
50
  get headerCount(): number;
49
- eachCell(options: any, iteratee?: any): void;
51
+ eachCell(options: {
52
+ includeEmpty?: boolean;
53
+ } | ((cell: Cell, rowNumber: number) => void), iteratee?: (cell: Cell, rowNumber: number) => void): void;
50
54
  get values(): any[];
51
55
  set values(v: any[]);
52
56
  _applyStyle(name: string, value: any): any;
@@ -1,3 +1,4 @@
1
+ import { Cell } from "./cell.js";
1
2
  import type { Worksheet } from "./worksheet.js";
2
3
  interface CellAddress {
3
4
  address: string;
@@ -26,22 +27,22 @@ interface EachCellOptions {
26
27
  declare class Row {
27
28
  _worksheet: Worksheet;
28
29
  _number: number;
29
- _cells: any[];
30
- style: any;
30
+ _cells: (Cell | undefined)[];
31
+ style: Record<string, unknown>;
31
32
  _hidden?: boolean;
32
33
  _outlineLevel?: number;
33
34
  height?: number;
34
35
  constructor(worksheet: any, number: number);
35
36
  get number(): number;
36
- get worksheet(): any;
37
+ get worksheet(): Worksheet;
37
38
  commit(): void;
38
39
  destroy(): void;
39
- findCell(colNumber: number): any;
40
- getCellEx(address: CellAddress): any;
41
- getCell(col: string | number): any;
40
+ findCell(colNumber: number): Cell | undefined;
41
+ getCellEx(address: CellAddress): Cell;
42
+ getCell(col: string | number): Cell;
42
43
  splice(start: number, count: number, ...inserts: any[]): void;
43
- eachCell(iteratee: (cell: any, colNumber: number) => void): void;
44
- eachCell(options: EachCellOptions, iteratee: (cell: any, colNumber: number) => void): void;
44
+ eachCell(iteratee: (cell: Cell, colNumber: number) => void): void;
45
+ eachCell(options: EachCellOptions, iteratee: (cell: Cell, colNumber: number) => void): void;
45
46
  addPageBreak(lft?: number, rght?: number): void;
46
47
  get values(): any[];
47
48
  set values(value: any[] | {
@@ -147,8 +147,8 @@ declare class Worksheet {
147
147
  _copyStyle(src: number, dest: number, styleEmpty?: boolean): void;
148
148
  duplicateRow(rowNum: number, count: number, insert?: boolean): void;
149
149
  spliceRows(start: number, count: number, ...inserts: any[]): void;
150
- eachRow(iteratee: (row: any, rowNumber: number) => void): void;
151
- eachRow(options: EachRowOptions, iteratee: (row: any, rowNumber: number) => void): void;
150
+ eachRow(iteratee: (row: Row, rowNumber: number) => void): void;
151
+ eachRow(options: EachRowOptions, iteratee: (row: Row, rowNumber: number) => void): void;
152
152
  getSheetValues(): any[];
153
153
  findCell(r: number | string, c?: number): any;
154
154
  getCell(r: number | string, c?: number): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cj-tech-master/excelts",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -107,9 +107,9 @@
107
107
  "devDependencies": {
108
108
  "@eslint/js": "^9.39.1",
109
109
  "@oxc-node/core": "^0.0.35",
110
- "@types/node": "^24.10.1",
111
- "@typescript-eslint/eslint-plugin": "^8.48.1",
112
- "@typescript-eslint/parser": "^8.48.1",
110
+ "@types/node": "^25.0.0",
111
+ "@typescript-eslint/eslint-plugin": "^8.49.0",
112
+ "@typescript-eslint/parser": "^8.49.0",
113
113
  "@typescript/native-preview": "^7.0.0-dev.20251208.1",
114
114
  "@vitest/browser": "^4.0.15",
115
115
  "@vitest/browser-playwright": "^4.0.15",
@@ -120,22 +120,22 @@
120
120
  "eslint-config-prettier": "^10.1.8",
121
121
  "eslint-import-resolver-typescript": "^4.4.4",
122
122
  "eslint-plugin-import-x": "^4.16.1",
123
- "eslint-plugin-oxlint": "^1.31.0",
123
+ "eslint-plugin-oxlint": "^1.32.0",
124
124
  "eslint-plugin-unused-imports": "^4.3.0",
125
125
  "express": "^5.2.1",
126
126
  "fast-xml-parser": "^5.3.2",
127
127
  "husky": "^9.1.7",
128
128
  "node-stdlib-browser": "^1.3.1",
129
129
  "nodemon": "^3.1.11",
130
- "oxlint": "^1.31.0",
130
+ "oxlint": "^1.32.0",
131
131
  "playwright": "^1.57.0",
132
132
  "prettier": "^3.7.4",
133
133
  "rimraf": "^6.1.2",
134
- "rolldown": "^1.0.0-beta.53",
134
+ "rolldown": "^1.0.0-beta.54",
135
135
  "rollup-plugin-visualizer": "^6.0.5",
136
136
  "tslib": "^2.8.1",
137
137
  "typescript": "^5.9.3",
138
- "typescript-eslint": "^8.48.1",
138
+ "typescript-eslint": "^8.49.0",
139
139
  "vite-tsconfig-paths": "^5.1.4",
140
140
  "vitest": "^4.0.15"
141
141
  },