Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exportItem() {
if (!this.state.selected) return this.gridOptions.api.deselectAll();
FileSaver.saveAs(new Blob([csv.serialize({fields: Object.keys(this.state.selected[0]).map((key) => ({id: key})), records: this.state.selected})], {type: 'text/csv;charset=utf-8'}), document.getElementById('main-view').querySelector('div.title').innerText + '.csv');
return this.gridOptions.api.deselectAll();
}