silphius/app/astride/test/expression.js
2024-06-22 10:47:17 -05:00

9 lines
201 B
JavaScript

export default async function(code) {
const {parse} = await import('acorn');
const ast = parse(code, {
ecmaVersion: 'latest',
sourceType: 'module',
});
return ast.body[0].expression;
}