gemcap-be-common 1.3.43 → 1.3.44
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/helpers/excel.helper.js
CHANGED
|
@@ -38,6 +38,7 @@ exports.NUMBER_FORMATS = {
|
|
|
38
38
|
thousands: '0.0,',
|
|
39
39
|
percent: '0.00%',
|
|
40
40
|
percent1DP: '0.0%',
|
|
41
|
+
currency$: '$#,##0.00',
|
|
41
42
|
};
|
|
42
43
|
const defaultColumnWidth = 20;
|
|
43
44
|
const convertDataToFile = async (dataToConvert) => {
|
|
@@ -92,9 +93,6 @@ const checkData = (dataToConvert) => {
|
|
|
92
93
|
if (cell.v === Infinity || (typeof cell.v === 'number' && !isFinite(cell.v))) {
|
|
93
94
|
console.warn(`❌ Non-finite number at ${pos}:`, cell);
|
|
94
95
|
}
|
|
95
|
-
if (cell.v === null && cell.z) {
|
|
96
|
-
console.warn(`❌ Null value with format (z) at ${pos}:`, cell);
|
|
97
|
-
}
|
|
98
96
|
if (cell.t === 'd' && !(cell.v instanceof Date) && typeof cell.v !== 'number') {
|
|
99
97
|
console.warn(`❌ cell.t === 'd' but v is not Date or number at ${pos}:`, cell);
|
|
100
98
|
}
|
|
@@ -104,6 +102,9 @@ const checkData = (dataToConvert) => {
|
|
|
104
102
|
if (cell.t === 'b' && typeof cell.v !== 'boolean') {
|
|
105
103
|
console.warn(`❌ cell.t === 'b' but v is not boolean at ${pos}:`, cell);
|
|
106
104
|
}
|
|
105
|
+
if (cell.v === null && cell.z) {
|
|
106
|
+
console.warn(`❌ Null value with format (z) at ${pos}:`, cell);
|
|
107
|
+
}
|
|
107
108
|
});
|
|
108
109
|
});
|
|
109
110
|
}
|
package/helpers/excel.helper.ts
CHANGED
|
@@ -10,6 +10,7 @@ export const NUMBER_FORMATS = {
|
|
|
10
10
|
thousands: '0.0,',
|
|
11
11
|
percent: '0.00%',
|
|
12
12
|
percent1DP: '0.0%',
|
|
13
|
+
currency$: '$#,##0.00',
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export interface IExcelDataCellWithStyles {
|
|
@@ -87,10 +88,6 @@ const checkData = (dataToConvert: { [sheetName: string]: IExcelDataCellWithStyle
|
|
|
87
88
|
console.warn(`❌ Non-finite number at ${pos}:`, cell);
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
if (cell.v === null && cell.z) {
|
|
91
|
-
console.warn(`❌ Null value with format (z) at ${pos}:`, cell);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
91
|
if (cell.t === 'd' && !(cell.v instanceof Date) && typeof cell.v !== 'number') {
|
|
95
92
|
console.warn(`❌ cell.t === 'd' but v is not Date or number at ${pos}:`, cell);
|
|
96
93
|
}
|
|
@@ -102,6 +99,10 @@ const checkData = (dataToConvert: { [sheetName: string]: IExcelDataCellWithStyle
|
|
|
102
99
|
if (cell.t === 'b' && typeof cell.v !== 'boolean') {
|
|
103
100
|
console.warn(`❌ cell.t === 'b' but v is not boolean at ${pos}:`, cell);
|
|
104
101
|
}
|
|
102
|
+
|
|
103
|
+
if (cell.v === null && cell.z) {
|
|
104
|
+
console.warn(`❌ Null value with format (z) at ${pos}:`, cell);
|
|
105
|
+
}
|
|
105
106
|
});
|
|
106
107
|
});
|
|
107
108
|
}
|