fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 13f9bb3e76 - Show all commits

View file

@ -320,10 +320,12 @@ export class GBVMService extends GBService {
code = parsedCode; code = parsedCode;
} }
parsedCode = this.handleThisAndAwait(parsedCode); parsedCode = this.handleThisAndAwait(parsedCode);
parsedCode = parsedCode.replace(/(now)(?=(?:[^"]|"[^"]*")*$)/, 'await this.getNow(step)'); parsedCode = parsedCode.replace(/(now)(?=(?:[^"]|"[^"]*")*$)/gi, 'await this.getNow(step)');
parsedCode = parsedCode.replace(/(today)(?=(?:[^"]|"[^"]*")*$)/, 'await this.getToday(step)'); parsedCode = parsedCode.replace(/(today)(?=(?:[^"]|"[^"]*")*$)/gi, 'await this.getToday(step)');
parsedCode = beautify(parsedCode, { indent_size: 2, space_in_empty_paren: true }); parsedCode = beautify(parsedCode, { indent_size: 2, space_in_empty_paren: true });
fs.writeFileSync(jsfile, parsedCode); fs.writeFileSync(jsfile, parsedCode);