Skip to content

Commit

Permalink
fix: golf
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcgrath13 committed Jan 7, 2025
1 parent 3c90bba commit b0045d6
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions containers/ecr-viewer/src/app/services/formatService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -548,27 +548,24 @@ function processTable(table: Element): TableRow[] {
row.querySelectorAll("td").forEach((cell, cellIndex) => {
const key = hasHeaders ? keys[cellIndex] : "Unknown Header";

const metaData: Metadata = {};
const metadata: Metadata = {};
const attributes = cell.attributes || [];
for (const element of attributes) {
const attrName = element.nodeName;
const attrValue = element.nodeValue;
if (attrName && attrValue) {
metaData[attrName] = attrValue;
metadata[attrName] = attrValue;
}
}
let content = getElementContent(cell);
let value = getElementContent(cell);
if (
typeof content === "string" &&
typeof value === "string" &&
(key.toLowerCase().includes("date") ||
key.toLowerCase().includes("time"))
) {
content = formatDateTime(content);
value = formatDateTime(value);
}
obj[key] = {
value: content,
metadata: metaData,
};
obj[key] = { value, metadata };
});
jsonArray.push(obj);
});
Expand Down

0 comments on commit b0045d6

Please sign in to comment.