From 7e5f946be708b723140781c6ab3e14eaef4e6935 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Thu, 19 Sep 2024 23:36:34 -0700 Subject: [PATCH] chore: code tidying --- .../commands/app-data/report/reporters/asset-summary.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/scripts/src/commands/app-data/report/reporters/asset-summary.ts b/packages/scripts/src/commands/app-data/report/reporters/asset-summary.ts index 73d50b418c..f96e01c923 100644 --- a/packages/scripts/src/commands/app-data/report/reporters/asset-summary.ts +++ b/packages/scripts/src/commands/app-data/report/reporters/asset-summary.ts @@ -6,6 +6,7 @@ import { IParsedWorkbookData } from "../../convert/types"; interface IReportData { path: string; count: number; + size_kb?: number; missing?: true; } @@ -46,7 +47,10 @@ export class AssetsSummaryReport { const summaryData: IReportData[] = Object.entries(sortJsonKeys(this.reportSummary)).map( ([path, count]) => { const entry: IReportData = { path, count }; - if (!this.assetData.hasOwnProperty(path)) { + const assetDataEntry = this.assetData[path]; + if (assetDataEntry) { + entry.size_kb = assetDataEntry.size_kb; + } else { entry.missing = true; } return entry; @@ -62,7 +66,7 @@ export class AssetsSummaryReport { description: "Assets that are used within sheets and also can be found in the synced asset data", type: "table", - columns: ["path", "count"], + columns: ["path", "size_kb", "count"], }; // Generate report summarising