@lightdash/common 0.1426.1 → 0.1426.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +13 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -425,19 +425,21 @@ function formatRawValue(field, value) {
|
|
425
425
|
return value;
|
426
426
|
}
|
427
427
|
function formatRows(rows, itemsMap) {
|
428
|
-
return rows.map((row) =>
|
429
|
-
const
|
430
|
-
const
|
431
|
-
|
432
|
-
|
433
|
-
[columnName]
|
428
|
+
return rows.map((row) => {
|
429
|
+
const resultRow = {};
|
430
|
+
const columnNames = Object.keys(row || {});
|
431
|
+
for (const columnName of columnNames) {
|
432
|
+
const value = row[columnName];
|
433
|
+
const item = itemsMap[columnName];
|
434
|
+
resultRow[columnName] = {
|
434
435
|
value: {
|
435
|
-
raw: formatRawValue(item,
|
436
|
-
formatted: (0, formatting_1.formatItemValue)(item,
|
436
|
+
raw: formatRawValue(item, value),
|
437
|
+
formatted: (0, formatting_1.formatItemValue)(item, value),
|
437
438
|
},
|
438
|
-
}
|
439
|
-
}
|
440
|
-
|
439
|
+
};
|
440
|
+
}
|
441
|
+
return resultRow;
|
442
|
+
});
|
441
443
|
}
|
442
444
|
exports.formatRows = formatRows;
|
443
445
|
const isObject = (object) => object != null && typeof object === 'object';
|