@lightdash/common 0.1426.1 → 0.1426.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/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';
|