Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public _$download() {
let zip = new JSZip();
const base64Codes = this._getGraphBase64Codes();
base64Codes.forEach(base64Code => {
zip.file(`${base64Code.title}.png`, base64Code.base64, {base64: true});
});
const jigsawGraphDownloadExportFileName = !!this.initData.jigsawGraphDownloadExportFileName.match(/(.+)\.(.+)/g) ?
this.initData.jigsawGraphDownloadExportFileName : `${this.initData.jigsawGraphDownloadExportFileName}.zip`;
zip.generateAsync({type: "blob"}).then(content => {
FileSaver.saveAs(content, `${jigsawGraphDownloadExportFileName}`);
});
}
}