diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index 44bc58c..8889628 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -78,7 +78,7 @@ const sheetmanage = { let copyWord = "(" + locale_info.copy; const copy_i = name.toString().indexOf(copyWord); - if (copy_i > -1) { + if (~copy_i) { name = name.toString().substring(0, copy_i); } @@ -86,17 +86,17 @@ const sheetmanage = { let nameCopy = name + copyWord; const sheetNames = []; - for(let i = 0; i < file.length; i++){ + for (let i = 0; i < file.length; i++) { let fileName = file[i].name.toString(); sheetNames.push(fileName); let st_i = fileName.indexOf(nameCopy); - if(st_i === 0){ + if(st_i === 0) { index = index || 2; let ed_i = fileName.indexOf(")", st_i + nameCopy.length); let num = fileName.substring(st_i + nameCopy.length, ed_i); - if(isRealNum(num)){ + if (isRealNum(num)) { if(parseInt(num) >= index){ index = parseInt(num) + 1; }