Skip to content

Commit

Permalink
Avoid using eval directly
Browse files Browse the repository at this point in the history
  • Loading branch information
oleeskild committed Oct 5, 2023
1 parent 9337957 commit fa59369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/DataviewCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function tryEval(query: string) {
let result = "";

try {
result = eval("const dv = DataviewAPI;" + query);
result = (0, eval)("const dv = DataviewAPI;" + query); //https://esbuild.github.io/content-types/#direct-eval
} catch (e) {
Logger.warn("eval did not yield any result", e);
}
Expand Down

0 comments on commit fa59369

Please sign in to comment.