mirror of https://github.com/Nofated095/Q2TG.git
fix: 导入 file-type 时出错
https://github.com/microsoft/TypeScript/issues/43329
This commit is contained in:
parent
081ecde6b7
commit
61c79bb0e7
|
@ -8,7 +8,7 @@ const log = getLogger('ForwardHelper');
|
|||
|
||||
export default {
|
||||
async downloadToCustomFile(url: string) {
|
||||
const { fileTypeFromBuffer } = await import('file-type');
|
||||
const { fileTypeFromBuffer } = await (Function('return import("file-type")')() as Promise<typeof import('file-type')>);
|
||||
const file = await fetchFile(url);
|
||||
const type = await fileTypeFromBuffer(file);
|
||||
return new CustomFile(`image.${type.ext}`, file.length, '', file);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"module": "nodenext",
|
||||
"target": "ESNext",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": false,
|
||||
|
|
Loading…
Reference in New Issue