mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-20 20:06:39 +00:00
Merge dev into fix/log-analytics-adjustments
This commit is contained in:
@@ -2,15 +2,17 @@ export function generateCSV(data: any[]): string {
|
||||
if (data.length === 0) {
|
||||
return "orgId,action,actorType,timestamp,actor\n";
|
||||
}
|
||||
|
||||
|
||||
const headers = Object.keys(data[0]).join(",");
|
||||
const rows = data.map(row =>
|
||||
Object.values(row).map(value =>
|
||||
typeof value === 'string' && value.includes(',')
|
||||
? `"${value.replace(/"/g, '""')}"`
|
||||
: value
|
||||
).join(",")
|
||||
const rows = data.map((row) =>
|
||||
Object.values(row)
|
||||
.map((value) =>
|
||||
typeof value === "string" && value.includes(",")
|
||||
? `"${value.replace(/"/g, '""')}"`
|
||||
: value
|
||||
)
|
||||
.join(",")
|
||||
);
|
||||
|
||||
|
||||
return [headers, ...rows].join("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,4 +90,4 @@ export type QueryAccessAuditLogResponse = {
|
||||
}[];
|
||||
locations: string[];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user