MCPcopy
hub / github.com/donmccurdy/glTF-Transform / formatPropertyReport

Function formatPropertyReport

packages/cli/src/inspect.ts:112–129  ·  view source on GitHub ↗
(property: AnyPropertyReport, index: number, format: TableFormat)

Source from the content-addressed store, hash-verified

110}
111
112function formatPropertyReport(property: AnyPropertyReport, index: number, format: TableFormat): Record<string, string> {
113 const row: Record<string, string | number> = { '#': index };
114 for (const key in property) {
115 const value = (property as unknown as Record<string, string | number>)[key];
116 if (Array.isArray(value)) {
117 row[key] = value.join(', ');
118 } else if (key.match(/size/i) && format !== TableFormat.CSV) {
119 row[key] = (value as number) > 0 ? formatBytes(value as number) : '';
120 } else if (typeof value === 'number') {
121 row[key] = format !== TableFormat.CSV ? formatLong(value) : value;
122 } else if (typeof value === 'boolean') {
123 row[key] = value ? '✓' : '';
124 } else {
125 row[key] = value;
126 }
127 }
128 return row as Record<string, string>;
129}
130
131function getFootnotes(type: string, header: string[]): string[] {
132 const footnotes = [];

Callers 1

reportSectionFunction · 0.85

Calls 3

matchMethod · 0.65
formatBytesFunction · 0.50
formatLongFunction · 0.50

Tested by

no test coverage detected