MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / downloadCSV

Function downloadCSV

apps/start/src/utils/csv-download.ts:14–24  ·  view source on GitHub ↗
(content: string, filename: string)

Source from the content-addressed store, hash-verified

12}
13
14export function downloadCSV(content: string, filename: string): void {
15 const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' });
16 const url = URL.createObjectURL(blob);
17 const link = document.createElement('a');
18 link.href = url;
19 link.download = filename;
20 document.body.appendChild(link);
21 link.click();
22 document.body.removeChild(link);
23 URL.revokeObjectURL(url);
24}
25
26export function cohortMembersToCSV(profileIds: string[]): string {
27 if (!profileIds.length) return '';

Callers 2

handleDownloadFunction · 0.90
handleDownloadFunction · 0.90

Calls 2

appendChildMethod · 0.80
removeChildMethod · 0.45

Tested by

no test coverage detected