microsoft-graph 2.18.4 → 2.18.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.
- package/dist/cjs/services/rangeManipulation.d.ts +5 -1
- package/dist/cjs/services/rangeManipulation.d.ts.map +1 -1
- package/dist/cjs/services/rangeManipulation.js +8 -8
- package/dist/esm/services/rangeManipulation.d.ts +5 -1
- package/dist/esm/services/rangeManipulation.d.ts.map +1 -1
- package/dist/esm/services/rangeManipulation.js +8 -8
- package/package.json +1 -1
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { Address } from "../models/Address.ts";
|
|
2
2
|
import type { CellRangeValues } from "../models/CellRangeValues.ts";
|
|
3
|
+
import type { ColumnOffset } from "../models/ColumnOffset.ts";
|
|
4
|
+
import type { RowOffset } from "../models/RowOffset.ts";
|
|
3
5
|
/**
|
|
4
6
|
* Converts a 2D array of cell values into range address in the upper left.
|
|
5
7
|
*
|
|
6
8
|
* @param {CellRangeValues} values - A 2D array representing cell values.
|
|
9
|
+
* @param {RowOffset} [rowOffset=0] - The row offset to apply to the range address.
|
|
10
|
+
* @param {ColumnOffset} [columnOffset=0] - The column offset to apply to the range address.
|
|
7
11
|
* @returns {Address} The default cell range address (e.g., "A1:C3").
|
|
8
12
|
* @throws {InvalidArgumentError} If rows have inconsistent column counts.
|
|
9
13
|
*/
|
|
10
|
-
export declare function inferRangeAddress(values: CellRangeValues): Address;
|
|
14
|
+
export declare function inferRangeAddress(values: CellRangeValues, rowOffset?: RowOffset, columnOffset?: ColumnOffset): Address;
|
|
11
15
|
/**
|
|
12
16
|
* Converts a 2D array of cell values into an array of objects.
|
|
13
17
|
* Assumes the first row is a header and uses it as keys for the objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rangeManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/rangeManipulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"rangeManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/rangeManipulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,SAAS,GAAE,SAA0B,EAAE,YAAY,GAAE,YAAgC,GAAG,OAAO,CAyBzJ;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoBnE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,GAAE,MAAM,EAAE,GAAG,IAAW,GAAG,eAAe,CASjG"}
|
|
@@ -12,12 +12,14 @@ const cartesianAddress_ts_1 = require("./cartesianAddress.js");
|
|
|
12
12
|
* Converts a 2D array of cell values into range address in the upper left.
|
|
13
13
|
*
|
|
14
14
|
* @param {CellRangeValues} values - A 2D array representing cell values.
|
|
15
|
+
* @param {RowOffset} [rowOffset=0] - The row offset to apply to the range address.
|
|
16
|
+
* @param {ColumnOffset} [columnOffset=0] - The column offset to apply to the range address.
|
|
15
17
|
* @returns {Address} The default cell range address (e.g., "A1:C3").
|
|
16
18
|
* @throws {InvalidArgumentError} If rows have inconsistent column counts.
|
|
17
19
|
*/
|
|
18
|
-
function inferRangeAddress(values) {
|
|
20
|
+
function inferRangeAddress(values, rowOffset = 0, columnOffset = 0) {
|
|
19
21
|
const first = values[0];
|
|
20
|
-
if (!first) {
|
|
22
|
+
if (!first || first.length === 0) {
|
|
21
23
|
return "A1";
|
|
22
24
|
}
|
|
23
25
|
for (const row of values) {
|
|
@@ -27,14 +29,12 @@ function inferRangeAddress(values) {
|
|
|
27
29
|
}
|
|
28
30
|
const rowCount = values.length;
|
|
29
31
|
const columnCount = first.length;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const endRow = (rowCount - 1);
|
|
33
|
-
const endColumn = (columnCount - 1);
|
|
32
|
+
const endRow = (rowOffset + rowCount - 1);
|
|
33
|
+
const endColumn = (columnOffset + columnCount - 1);
|
|
34
34
|
return (0, cartesianAddress_ts_1.cartesianToAddress)({
|
|
35
|
-
ax:
|
|
36
|
-
ay: startRow,
|
|
35
|
+
ax: columnOffset,
|
|
37
36
|
bx: endColumn,
|
|
37
|
+
ay: rowOffset,
|
|
38
38
|
by: endRow,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { Address } from "../models/Address.ts";
|
|
2
2
|
import type { CellRangeValues } from "../models/CellRangeValues.ts";
|
|
3
|
+
import type { ColumnOffset } from "../models/ColumnOffset.ts";
|
|
4
|
+
import type { RowOffset } from "../models/RowOffset.ts";
|
|
3
5
|
/**
|
|
4
6
|
* Converts a 2D array of cell values into range address in the upper left.
|
|
5
7
|
*
|
|
6
8
|
* @param {CellRangeValues} values - A 2D array representing cell values.
|
|
9
|
+
* @param {RowOffset} [rowOffset=0] - The row offset to apply to the range address.
|
|
10
|
+
* @param {ColumnOffset} [columnOffset=0] - The column offset to apply to the range address.
|
|
7
11
|
* @returns {Address} The default cell range address (e.g., "A1:C3").
|
|
8
12
|
* @throws {InvalidArgumentError} If rows have inconsistent column counts.
|
|
9
13
|
*/
|
|
10
|
-
export declare function inferRangeAddress(values: CellRangeValues): Address;
|
|
14
|
+
export declare function inferRangeAddress(values: CellRangeValues, rowOffset?: RowOffset, columnOffset?: ColumnOffset): Address;
|
|
11
15
|
/**
|
|
12
16
|
* Converts a 2D array of cell values into an array of objects.
|
|
13
17
|
* Assumes the first row is a header and uses it as keys for the objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rangeManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/rangeManipulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"rangeManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/rangeManipulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,SAAS,GAAE,SAA0B,EAAE,YAAY,GAAE,YAAgC,GAAG,OAAO,CAyBzJ;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoBnE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,GAAE,MAAM,EAAE,GAAG,IAAW,GAAG,eAAe,CASjG"}
|
|
@@ -4,12 +4,14 @@ import { cartesianToAddress } from "./cartesianAddress.js";
|
|
|
4
4
|
* Converts a 2D array of cell values into range address in the upper left.
|
|
5
5
|
*
|
|
6
6
|
* @param {CellRangeValues} values - A 2D array representing cell values.
|
|
7
|
+
* @param {RowOffset} [rowOffset=0] - The row offset to apply to the range address.
|
|
8
|
+
* @param {ColumnOffset} [columnOffset=0] - The column offset to apply to the range address.
|
|
7
9
|
* @returns {Address} The default cell range address (e.g., "A1:C3").
|
|
8
10
|
* @throws {InvalidArgumentError} If rows have inconsistent column counts.
|
|
9
11
|
*/
|
|
10
|
-
export function inferRangeAddress(values) {
|
|
12
|
+
export function inferRangeAddress(values, rowOffset = 0, columnOffset = 0) {
|
|
11
13
|
const first = values[0];
|
|
12
|
-
if (!first) {
|
|
14
|
+
if (!first || first.length === 0) {
|
|
13
15
|
return "A1";
|
|
14
16
|
}
|
|
15
17
|
for (const row of values) {
|
|
@@ -19,14 +21,12 @@ export function inferRangeAddress(values) {
|
|
|
19
21
|
}
|
|
20
22
|
const rowCount = values.length;
|
|
21
23
|
const columnCount = first.length;
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const endRow = (rowCount - 1);
|
|
25
|
-
const endColumn = (columnCount - 1);
|
|
24
|
+
const endRow = (rowOffset + rowCount - 1);
|
|
25
|
+
const endColumn = (columnOffset + columnCount - 1);
|
|
26
26
|
return cartesianToAddress({
|
|
27
|
-
ax:
|
|
28
|
-
ay: startRow,
|
|
27
|
+
ax: columnOffset,
|
|
29
28
|
bx: endColumn,
|
|
29
|
+
ay: rowOffset,
|
|
30
30
|
by: endRow,
|
|
31
31
|
});
|
|
32
32
|
}
|