Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async downloadImages() {
this.isDownloading = true;
const scriptName = this.project.scripts[this.displayScript || this.project.activeScript].name;
const zip = new JSZip();
const gameCards = this.gameCards.map(x => x.nativeElement);
let curIdx = 0;
let curBack = 0;
let curFront = 0;
const convertPromises = [];
gameCards.forEach(async value => {
const cardRef = this.cardDisplayList[curIdx++];
const imgStringPromise = domtoimage.toBlob(value);
const num = cardRef._front ? curFront : curBack;
if(cardRef._front) curFront++;
else curBack++;zip(){
var zip = new JSZip();
let source = this.source.data;
for( let name in source )
zip.file( name, source[name]);
zip.generateAsync({type:"blob"})
.then( content => {
if( !this.saver ){
let dom = new DOM(this.DOM.create("div", {
id:"el",
className:"FileSaver",
onclick:_=>this.saver.el.style.display = "none"
}, [
["a", {download() {
const zip = new JSZip();
values(this.project.scripts).forEach(script => {
zip.file(this.replaceName(script.name), script.contents);
});
zip.generateAsync({ type: 'blob' })
.then((blob) => {
saveAs(blob, `${this.project.name}-${Date.now()}.zip`);
});
}