microsoft-graph 2.11.1 → 2.11.3
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 +2 -1
- package/dist/cjs/services/rangeManipulation.d.ts.map +1 -1
- package/dist/cjs/services/rangeManipulation.js +5 -4
- package/dist/esm/services/rangeManipulation.d.ts +2 -1
- package/dist/esm/services/rangeManipulation.d.ts.map +1 -1
- package/dist/esm/services/rangeManipulation.js +5 -4
- package/package.json +1 -1
|
@@ -22,7 +22,8 @@ export declare function inferRangeObject(values: CellRangeValues): unknown[];
|
|
|
22
22
|
* The first row of the 2D array contains the keys as headers.
|
|
23
23
|
*
|
|
24
24
|
* @param {unknown[]} objs - An array of objects to convert.
|
|
25
|
+
* @param {string[] | null} header - Optional header row. If not provided, it will be inferred from the object keys.
|
|
25
26
|
* @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
|
|
26
27
|
*/
|
|
27
|
-
export declare function inferObjectRange(objs: unknown[]): CellRangeValues;
|
|
28
|
+
export declare function inferObjectRange(objs: unknown[], header?: string[] | null): CellRangeValues;
|
|
28
29
|
//# sourceMappingURL=rangeManipulation.d.ts.map
|
|
@@ -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;AAMpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA4BlE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoBnE;AAED
|
|
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;AAMpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA4BlE;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"}
|
|
@@ -66,13 +66,14 @@ function inferRangeObject(values) {
|
|
|
66
66
|
* The first row of the 2D array contains the keys as headers.
|
|
67
67
|
*
|
|
68
68
|
* @param {unknown[]} objs - An array of objects to convert.
|
|
69
|
+
* @param {string[] | null} header - Optional header row. If not provided, it will be inferred from the object keys.
|
|
69
70
|
* @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
|
|
70
71
|
*/
|
|
71
|
-
function inferObjectRange(objs) {
|
|
72
|
+
function inferObjectRange(objs, header = null) {
|
|
72
73
|
if (objs.length === 0) {
|
|
73
74
|
return [];
|
|
74
75
|
}
|
|
75
|
-
const
|
|
76
|
-
const rows = objs.map((obj) =>
|
|
77
|
-
return [
|
|
76
|
+
const usedHeader = header ?? Array.from(new Set(objs.flatMap((obj) => Object.keys(obj))));
|
|
77
|
+
const rows = objs.map((obj) => usedHeader.map((key) => obj[key]));
|
|
78
|
+
return [usedHeader, ...rows];
|
|
78
79
|
}
|
|
@@ -22,7 +22,8 @@ export declare function inferRangeObject(values: CellRangeValues): unknown[];
|
|
|
22
22
|
* The first row of the 2D array contains the keys as headers.
|
|
23
23
|
*
|
|
24
24
|
* @param {unknown[]} objs - An array of objects to convert.
|
|
25
|
+
* @param {string[] | null} header - Optional header row. If not provided, it will be inferred from the object keys.
|
|
25
26
|
* @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
|
|
26
27
|
*/
|
|
27
|
-
export declare function inferObjectRange(objs: unknown[]): CellRangeValues;
|
|
28
|
+
export declare function inferObjectRange(objs: unknown[], header?: string[] | null): CellRangeValues;
|
|
28
29
|
//# sourceMappingURL=rangeManipulation.d.ts.map
|
|
@@ -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;AAMpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA4BlE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoBnE;AAED
|
|
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;AAMpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA4BlE;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"}
|
|
@@ -58,13 +58,14 @@ export function inferRangeObject(values) {
|
|
|
58
58
|
* The first row of the 2D array contains the keys as headers.
|
|
59
59
|
*
|
|
60
60
|
* @param {unknown[]} objs - An array of objects to convert.
|
|
61
|
+
* @param {string[] | null} header - Optional header row. If not provided, it will be inferred from the object keys.
|
|
61
62
|
* @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
|
|
62
63
|
*/
|
|
63
|
-
export function inferObjectRange(objs) {
|
|
64
|
+
export function inferObjectRange(objs, header = null) {
|
|
64
65
|
if (objs.length === 0) {
|
|
65
66
|
return [];
|
|
66
67
|
}
|
|
67
|
-
const
|
|
68
|
-
const rows = objs.map((obj) =>
|
|
69
|
-
return [
|
|
68
|
+
const usedHeader = header ?? Array.from(new Set(objs.flatMap((obj) => Object.keys(obj))));
|
|
69
|
+
const rows = objs.map((obj) => usedHeader.map((key) => obj[key]));
|
|
70
|
+
return [usedHeader, ...rows];
|
|
70
71
|
}
|