fix: do not add default check for sharp

This commit is contained in:
Adhiraj Singh
2022-09-15 07:07:08 +05:30
parent 0f989751db
commit b05ce25dfa

View File

@@ -20,7 +20,7 @@ import { generateMessageID } from './generics'
const getTmpFilesDirectory = () => tmpdir()
const getImageProcessingLibrary = async() => {
const [_jimp, _sharp] = await Promise.all([
const [_jimp, sharp] = await Promise.all([
(async() => {
const jimp = await (
import('jimp')
@@ -36,11 +36,12 @@ const getImageProcessingLibrary = async() => {
return sharp
})()
])
const sharp = _sharp?.default ?? _sharp
if(sharp) {
return { sharp }
}
const jimp = _jimp?.default ?? _jimp
const jimp = _jimp?.default || _jimp
if(jimp) {
return { jimp }
}