Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (selection == 'marked') {
d = config.marked;
} else if (selection == 'both') {
d = config.selections();
} else {
throw "Please specify one of {'brushed', 'marked', 'both'}";
}
if (d.length > 0) {
// format data as csv
// NOTE: include assigned data id number?
const csv = csvFormat(d, config.vars);
// create url and download
const file = new Blob([csv], { type: 'text/csv' });
saveAs(file, filename);
} else {
throw 'Error: No data selected.';
}
return this;
};
function*() {
const data = yield callApi(api.export);
saveAs(data, "TruBudget_Export.xlsx");
yield put({
type: EXPORT_DATA_SUCCESS
});
},
true,
runExport(value: Array) {
this.update(value);
if (this.properties.length === 0) {
this.notificationService.error('There are no properties to export.');
} else {
const propertiesText = this.properties.join('\n');
const date = DateTime.local().toFormat('yyyy-MM-HHmmss');
const filename = `${this.refConfig.id}_${date}.txt`;
const blob = new Blob([propertiesText], { type: 'text/plain' });
saveAs(blob, filename);
}
}
private createDownload(csvContent: string[]) {
const file = new Blob(csvContent, {type: 'text/csv'});
saveAs(file, this.course.name.replace(/\s/g, '') + 'Report.csv');
}
}
export(rows, options) {
let headers = (options && options.headers) ||
(Object.keys((rows[0] || {})).sort());
let filename = (options && options.filename) || "export.csv";
let csvText = new CSV(rows, { header: headers }).encode();
let blob = new Blob([csvText], { type: "text/csv" });
saveAs(blob, filename);
}
}
response => saveAs(new Blob([JSON.stringify(response)], {type: 'text/plain;charset=utf-8'}),
'Classifications_' + TaskanaDate.getDate() + '.json')
);
canvas.toBlob((blob) => {
saveAs(blob, filename);
resetExport();
});
}
fileDownloadDeck() {
const fileData = convertDeckToFile(this.deckparts, this.deck.list);
const file = new File([fileData], `${this.deck.name}.ydk`, {
type: "text/ydk"
});
return FileSaver.saveAs(file);
},
copyShareText() {
visualizer.encodeVideo().then((blob) => {
this.recording = false;
if (this.game && this.game.game_id) {
saveAs(blob, `${this.game.game_id}.webm`);
}
else {
saveAs(blob, 'video.webm');
}
});
}