Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function uploadImage(
imageFilePath: string,
{
method = "imgur",
qiniu = { AccessKey: "", SecretKey: "", Bucket: "", Domain: "" },
},
): Promise {
if (method === "imgur") {
return imgurUploadImage(imageFilePath);
} else if (method === "qiniu") {
return qiniuUploadImage(
imageFilePath,
qiniu.AccessKey,
qiniu.SecretKey,
qiniu.Bucket,
qiniu.Domain,
);
} else {
// sm.ms
return smmsUploadImage(imageFilePath);
}
}