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