Fix types for extractFileFromZipBuffer
| @@ -550,7 +550,7 @@ async function importFromYaml(uploadPath, context, preservedFileName) { | |||
| 550 | * @returns {Promise<string>} Internal name of the character | 550 | * @returns {Promise<string>} Internal name of the character |
| 551 | */ | 551 | */ |
| 552 | async function importFromCharX(uploadPath, { request }, preservedFileName) { | 552 | async function importFromCharX(uploadPath, { request }, preservedFileName) { |
| 553 | const data = fs.readFileSync(uploadPath); | 553 | const data = fs.readFileSync(uploadPath).buffer; |
| 554 | fs.rmSync(uploadPath); | 554 | fs.rmSync(uploadPath); |
| 555 | console.log('Importing from CharX'); | 555 | console.log('Importing from CharX'); |
| 556 | const cardBuffer = await extractFileFromZipBuffer(data, 'card.json'); | 556 | const cardBuffer = await extractFileFromZipBuffer(data, 'card.json'); |
| @@ -157,7 +157,7 @@ export function formatBytes(bytes) { | |||
| 157 | 157 | ||
| 158 | /** | 158 | /** |
| 159 | * Extracts a file with given extension from an ArrayBuffer containing a ZIP archive. | 159 | * Extracts a file with given extension from an ArrayBuffer containing a ZIP archive. |
| 160 | * @param {ArrayBuffer} archiveBuffer Buffer containing a ZIP archive | 160 | * @param {ArrayBufferLike} archiveBuffer Buffer containing a ZIP archive |
| 161 | * @param {string} fileExtension File extension to look for | 161 | * @param {string} fileExtension File extension to look for |
| 162 | * @returns {Promise<Buffer|null>} Buffer containing the extracted file. Null if the file was not found. | 162 | * @returns {Promise<Buffer|null>} Buffer containing the extracted file. Null if the file was not found. |
| 163 | */ | 163 | */ |