Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add AST transform hooks #19

Merged
merged 4 commits into from
Aug 13, 2024
Merged

feat: Add AST transform hooks #19

merged 4 commits into from
Aug 13, 2024

Conversation

valya
Copy link
Contributor

@valya valya commented Aug 13, 2024

No description provided.

ivov
ivov previously approved these changes Aug 13, 2024
src/ast.ts Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
test/ASTHooks.test.ts Outdated Show resolved Hide resolved
Comment on lines 17 to 20
const hook: ASTAfterHook = (ast) => {
expect(ast.type).toBe('ExpressionStatement');
expect((ast as ExpressionStatement).expression.type).toBe('MemberExpression');
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So nifty to use test assertions in the hooks to be able to tell when they were called!

src/ExpressionBuilder.ts Outdated Show resolved Hide resolved
@valya valya requested a review from ivov August 13, 2024 14:35
@valya valya merged commit e9dd126 into main Aug 13, 2024
1 check passed
@netroy netroy deleted the transform-hooks branch August 13, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants