const fs = require('fs-extra'); const ConvertHtml = require('./ConvertHtml'); class ConvertDocX extends ConvertHtml { async check(data, opts) { const {inputFiles} = opts; if (this.config.useExternalBookConverter && inputFiles.sourceFileType && inputFiles.sourceFileType.ext == 'zip') { //ищем файл '[Content_Types].xml' for (const file of inputFiles.files) { if (file.path == '[Content_Types].xml') { const contentTypes = await fs.readFile(`${inputFiles.filesDir}/${file.path}`, 'utf8'); return contentTypes.indexOf('/fb3/body.xml') >= 0; } } } return false; } getTitle(text) { let title = ''; const m = text.match(/