Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const hint = `![Uploading ${imageFileName}… (${uid})]()`;
const curPos = editor.selection.active;
editor.edit((textEditorEdit) => {
textEditorEdit.insert(curPos, hint);
});
const config = vscode.workspace.getConfiguration(
"markdown-preview-enhanced",
);
const AccessKey = config.get("AccessKey") || "";
const SecretKey = config.get("SecretKey") || "";
const Bucket = config.get("Bucket") || "";
const Domain = config.get("Domain") || "";
utility
.uploadImage(imageFilePath, {
method: imageUploader,
qiniu: { AccessKey, SecretKey, Bucket, Domain },
})
.then((url) => {
setUploadedImageURL(imageFileName, url, editor, hint, curPos);
})
.catch((error) => {
vscode.window.showErrorMessage(error.toString());
});
});
}