Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public QuickNew() {
this.readConfig();
let file: string = path.normalize(path.join(this.memodir, dateFns.format(new Date(), 'YYYY-MM-DD') + ".md"));
let date: Date = new Date();
let dateFormat = this.memoDateFormat;
let getISOWeek = this.memoISOWeek == true ? "[Week: " + dateFns.getISOWeek(new Date()) + "/" + dateFns.getISOWeeksInYear(new Date()) + "] " : "";
let getEmoji = this.memoEmoji == true ? randomEmoji.random().emoji : "";
// console.log(getISOWeek);
// console.log(getEmoji);
fs.stat(file, async (err, files) => {
if (err) {
await fs.writeFile(file, "# " + dateFns.format(new Date(), `${dateFormat}`) + os.EOL + os.EOL, (err) => {
if (err) throw err;
});
}
});
// 選択されているテキストを取得
// エディタが一つも無い場合は、エラーになるので対処しておく
let editor = vscode.window.activeTextEditor;
let selectString: String = editor ? editor.document.getText(editor.selection) : "";