(path?: any)
| 1 | import {memoryParse} from './memoryParse'; |
| 2 | |
| 3 | export function isPureVariable(path?: any): path is string { |
| 4 | if (typeof path === 'string' && path.includes('$')) { |
| 5 | try { |
| 6 | const ast = memoryParse(path); |
| 7 | // 只有一个成员说明是纯表达式模式 |
| 8 | return ast?.body.length === 1 && ast.body[0].type === 'script'; |
| 9 | } catch (err) { |
| 10 | return false; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | return false; |
| 15 | } |
no test coverage detected