@harbortouch/skytab-analytics-report-utils 0.4.1 → 0.4.2

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.cjs CHANGED
@@ -627,6 +627,7 @@ function isNumericType(type) {
627
627
 
628
628
  // src/totals.ts
629
629
  function calculateReportTotals(data, fieldConfig, opts) {
630
+ const rows = data;
630
631
  const { labelField, label } = opts;
631
632
  const fieldsToSum = /* @__PURE__ */ new Set();
632
633
  const derivedFields = [];
@@ -648,7 +649,7 @@ function calculateReportTotals(data, fieldConfig, opts) {
648
649
  }
649
650
  const sums = {};
650
651
  for (const field of fieldsToSum) {
651
- sums[field] = data.reduce((acc, row) => acc + (row[field] ?? 0), 0);
652
+ sums[field] = rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
652
653
  }
653
654
  const derived = {};
654
655
  for (const { field, calc } of derivedFields) {
package/dist/index.js CHANGED
@@ -578,6 +578,7 @@ function isNumericType(type) {
578
578
 
579
579
  // src/totals.ts
580
580
  function calculateReportTotals(data, fieldConfig, opts) {
581
+ const rows = data;
581
582
  const { labelField, label } = opts;
582
583
  const fieldsToSum = /* @__PURE__ */ new Set();
583
584
  const derivedFields = [];
@@ -599,7 +600,7 @@ function calculateReportTotals(data, fieldConfig, opts) {
599
600
  }
600
601
  const sums = {};
601
602
  for (const field of fieldsToSum) {
602
- sums[field] = data.reduce((acc, row) => acc + (row[field] ?? 0), 0);
603
+ sums[field] = rows.reduce((acc, row) => acc + (row[field] ?? 0), 0);
603
604
  }
604
605
  const derived = {};
605
606
  for (const { field, calc } of derivedFields) {
package/dist/totals.d.ts CHANGED
@@ -3,4 +3,4 @@ export interface CalculateReportTotalsOptions {
3
3
  labelField: string;
4
4
  label: string;
5
5
  }
6
- export declare function calculateReportTotals<T extends Record<string, unknown>>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig>, opts: CalculateReportTotalsOptions): T;
6
+ export declare function calculateReportTotals<T>(data: T[], fieldConfig: Record<string, ColumnPresentationConfig>, opts: CalculateReportTotalsOptions): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbortouch/skytab-analytics-report-utils",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Centralized report column presentation configuration for SkyTab Analytics",
5
5
  "engines": {
6
6
  "node": ">=22.6.0",