@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.
Files changed (2) hide show
  1. package/dist/index.js +13 -11
  2. 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) => Object.keys(row).reduce((acc, columnName) => {
429
- const col = row[columnName];
430
- const item = itemsMap[columnName];
431
- return {
432
- ...acc,
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, col),
436
- formatted: (0, formatting_1.formatItemValue)(item, col),
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/common",
3
- "version": "0.1426.1",
3
+ "version": "0.1426.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [