mirror of
https://github.com/marcrobledo/RomPatcher.js.git
synced 2025-06-27 16:25:54 +00:00
added zip extension check, fixing #53
This commit is contained in:
parent
83ddcd23fc
commit
0769fae972
5 changed files with 17 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
/* MODDED VERSION OF MarcFile.js v20181020 - Marc Robledo 2014-2018 - http://www.marcrobledo.com/license */
|
||||
/* MODDED VERSION OF MarcFile.js v20230202 - Marc Robledo 2014-2023 - http://www.marcrobledo.com/license */
|
||||
|
||||
function MarcFile(source, onLoad){
|
||||
if(typeof source==='object' && source.files) /* get first file only if source is input with multiple files */
|
||||
|
@ -146,6 +146,13 @@ MarcFile.prototype.save=function(){
|
|||
}
|
||||
|
||||
|
||||
MarcFile.prototype.getExtension=function(){
|
||||
var ext=this.fileName? this.fileName.toLowerCase().match(/\.(\w+)$/) : '';
|
||||
|
||||
return ext? ext[1] : '';
|
||||
}
|
||||
|
||||
|
||||
MarcFile.prototype.readU8=function(){
|
||||
this._lastRead=this._u8array[this.offset];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue