Рефакторинг
This commit is contained in:
@@ -70,9 +70,8 @@ class InpxParser {
|
|||||||
this.chunk = [];
|
this.chunk = [];
|
||||||
for (const inpFile of inpFiles) {
|
for (const inpFile of inpFiles) {
|
||||||
await readFileCallback({fileName: inpFile, current: ++current});
|
await readFileCallback({fileName: inpFile, current: ++current});
|
||||||
const buf = await zipReader.extractToBuf(inpFile);
|
|
||||||
|
|
||||||
await this.parseInp(buf, structure, inpFile, parsedCallback);
|
await this.parseInp(zipReader, inpFile, structure, parsedCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.chunk.length) {
|
if (this.chunk.length) {
|
||||||
@@ -84,10 +83,12 @@ class InpxParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async parseInp(inpBuf, structure, inpFile, parsedCallback) {
|
async parseInp(zipReader, inpFile, structure, parsedCallback) {
|
||||||
const structLen = structure.length;
|
const inpBuf = await zipReader.extractToBuf(inpFile);
|
||||||
const rows = inpBuf.toString().split('\n');
|
const rows = inpBuf.toString().split('\n');
|
||||||
|
|
||||||
const defaultFolder = `${path.basename(inpFile, '.inp')}.zip`;
|
const defaultFolder = `${path.basename(inpFile, '.inp')}.zip`;
|
||||||
|
const structLen = structure.length;
|
||||||
|
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
let line = row;
|
let line = row;
|
||||||
|
|||||||
Reference in New Issue
Block a user