File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,8 +338,9 @@ class StorageZip extends IStorage {
338338 this . #storageO = null ;
339339 }
340340
341- async init ( path ) {
341+ async init ( path , freeze = true ) {
342342 this . #storageO = await ZIPHelpers . loadZipFromUrl ( path ) ;
343+ this . path = path ;
343344 this . storageO = this . #storageO;
344345 let hasSlip = false ;
345346 const paths = Object . keys ( this . #storageO. files ) ;
@@ -357,7 +358,8 @@ class StorageZip extends IStorage {
357358 pane . innerHTML = `⚠ ${ msg } ` ;
358359 throw new Error ( msg ) ;
359360 }
360- Object . freeze ( this . #storageO. files ) ;
361+ if ( freeze )
362+ Object . freeze ( this . #storageO. files ) ;
361363 return this ;
362364 }
363365
@@ -391,6 +393,12 @@ class StorageZip extends IStorage {
391393 var mimeType = 'image/' + filePath . split ( '.' ) . pop ( ) . toLowerCase ( ) ;
392394 return `data:${ mimeType } ;base64,${ content } ` ;
393395 }
396+
397+ async getCopyForChanges ( ) {
398+ const reply = new StorageZip ( ) ;
399+ await reply . init ( this . path , false ) ;
400+ return reply . #storageO;
401+ }
394402}
395403
396404function toText ( ab ) {
You can’t perform that action at this time.
0 commit comments