Skip to content

Commit

Permalink
条件判断语法增加异常处理
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxustudio committed Jun 10, 2024
1 parent 2062622 commit 1132597
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/webgal/src/Core/controller/gamePlay/strIf.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { compile } from 'angular-expressions';

export function strIf(s: string) {
const res = compile(s);
return res();
try {
const res = compile(s);
return res();
} catch {
return false;
}
}

0 comments on commit 1132597

Please sign in to comment.