From fd5976f378310daf6cef7b2bf435fa543f05579b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 24 Sep 2022 17:07:56 +0900 Subject: [PATCH] fix type --- packages/backend/package.json | 6 +++-- .../ExportCustomEmojisProcessorService.ts | 2 +- packages/backend/yarn.lock | 25 +++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index eccba10ed1..f2fe009a9c 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -31,8 +31,6 @@ "@peertube/http-signature": "1.7.0", "@sinonjs/fake-timers": "9.1.2", "@syuilo/aiscript": "0.11.1", - "@types/pg": "8.6.5", - "@types/unzipper": "0.10.5", "ajv": "8.11.0", "archiver": "5.3.1", "autobind-decorator": "2.4.0", @@ -133,6 +131,7 @@ "@redocly/openapi-core": "1.0.0-beta.108", "@swc/core": "1.3.2", "@swc/jest": "0.2.22", + "@types/archiver": "5.3.1", "@types/bcryptjs": "2.4.2", "@types/bull": "3.15.9", "@types/cbor": "6.0.0", @@ -154,10 +153,12 @@ "@types/koa__cors": "3.1.1", "@types/koa__multer": "2.0.4", "@types/koa__router": "8.0.11", + "@types/mime-types": "2.1.1", "@types/node": "18.7.18", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.6", "@types/oauth": "0.9.1", + "@types/pg": "8.6.5", "@types/pug": "2.0.6", "@types/punycode": "2.1.0", "@types/qrcode": "1.5.0", @@ -172,6 +173,7 @@ "@types/speakeasy": "2.0.7", "@types/tinycolor2": "1.4.3", "@types/tmp": "0.2.3", + "@types/unzipper": "0.10.5", "@types/uuid": "8.3.4", "@types/web-push": "3.3.2", "@types/websocket": "1.0.5", diff --git a/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts b/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts index aa7a0ef929..f8f261b478 100644 --- a/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts @@ -80,7 +80,7 @@ export class ExportCustomEmojisProcessorService { }); for (const emoji of customEmojis) { - const ext = mime.extension(emoji.type); + const ext = mime.extension(emoji.type ?? 'image/png'); const fileName = emoji.name + (ext ? '.' + ext : ''); const emojiPath = path + '/' + fileName; fs.writeFileSync(emojiPath, '', 'binary'); diff --git a/packages/backend/yarn.lock b/packages/backend/yarn.lock index f2ea0b0a58..598451fa80 100644 --- a/packages/backend/yarn.lock +++ b/packages/backend/yarn.lock @@ -1215,6 +1215,13 @@ dependencies: "@types/node" "*" +"@types/archiver@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@types/archiver/-/archiver-5.3.1.tgz#02991e940a03dd1a32678fead4b4ca03d0e387ca" + integrity sha512-wKYZaSXaDvTZuInAWjCeGG7BEAgTWG2zZW0/f7IYFcoHB2X2d9lkVFnrOlXl3W6NrvO6Ml3FLLu8Uksyymcpnw== + dependencies: + "@types/glob" "*" + "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" @@ -1348,6 +1355,14 @@ dependencies: "@types/node" "*" +"@types/glob@*": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.0.0.tgz#321607e9cbaec54f687a0792b2d1d370739455d2" + integrity sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + "@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -1565,11 +1580,21 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/mime-types@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.1.tgz#d9ba43490fa3a3df958759adf69396c3532cf2c1" + integrity sha512-vXOTGVSLR2jMw440moWTC7H19iUyLtP3Z1YTj7cSsubOICinjMxFeb/V57v9QdyyPGbbWolUFSSmSiRSn94tFw== + "@types/mime@*": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" integrity sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw== +"@types/minimatch@*": + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== + "@types/node-fetch@3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-3.0.3.tgz#9d969c9a748e841554a40ee435d26e53fa3ee899"