mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
form fields recaptcha v2 api integration recaptcha reset remove recaptcha key from git
15 lines
367 B
TypeScript
15 lines
367 B
TypeScript
import { unparse } from 'papaparse';
|
|
|
|
import downloadBlob from 'lib/downloadBlob';
|
|
|
|
export default function saveAsCSV(headerRows: Array<string>, dataRows: Array<Array<string>>, filename: string) {
|
|
const csv = unparse([
|
|
headerRows,
|
|
...dataRows,
|
|
]);
|
|
|
|
const blob = new Blob([ csv ], { type: 'text/csv;charset=utf-8;' });
|
|
|
|
downloadBlob(blob, filename);
|
|
}
|