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

Support for regexes in 'except' #40

Merged
merged 3 commits into from
Jun 9, 2021
Merged

Support for regexes in 'except' #40

merged 3 commits into from
Jun 9, 2021

Conversation

torshid
Copy link
Contributor

@torshid torshid commented Jun 2, 2021

Closes #38

Regexes can now be present in except in addition to strings.

except: [/full-.*/, ...] would both skip full-height and full-width.

Instead of checking if a node value is present in the exceptSet, I moved the logic to a function named skip.

Allowing except to be a function would also be nice, what do you think?

@nex3 nex3 requested a review from rzhw June 2, 2021 17:29
Copy link
Contributor

@rzhw rzhw left a comment

Choose a reason for hiding this comment

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

This is great, thank you for contributing this!

@rzhw
Copy link
Contributor

rzhw commented Jun 9, 2021

Allowing except to be a function would also be nice, what do you think?

I can definitely see this is a natural next step, happy to take a PR for this as well.

Given the current approach of checking exceptSet and then iterating to check for regexes every time I'm somewhat concerned whether long run this might cause performance issues (versus splitting exceptSet by type for example), but for the time being I think this will suffice.

Thanks again! Will merge and do a release

@rzhw rzhw merged commit 0f72882 into google:master Jun 9, 2021
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.

Support for regexes in the except array
2 participants