com-tools
Version:
com-tools 提供了一些通用的工具函数;
52 lines (25 loc) • 720 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [com-tools](./com-tools.md) > [betterEval](./com-tools.bettereval.md)
## betterEval() function
由于 eval() 有 安全 和 性能 的问题,所以封装了本函数 来 替代 eval() 本方法采用 Function 的方式 来实现 eval() 的效果;
**Signature:**
```typescript
export declare function betterEval(code: string): any;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
code
</td><td>
string
</td><td>
</td></tr>
</tbody></table>
**Returns:**
any