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

noDecorator option #89

Merged
merged 15 commits into from
May 9, 2023
Merged

noDecorator option #89

merged 15 commits into from
May 9, 2023

Conversation

dospunk
Copy link
Contributor

@dospunk dospunk commented Apr 19, 2023

Adds an option to match class members that have no decorator. It can also be used to match members that have any decorator by setting noDecorator: false

@dospunk
Copy link
Contributor Author

dospunk commented Apr 19, 2023

This would solve #86

@bryanrsmith
Copy link
Owner

Thanks for the pr! I am traveling at the moment, but will take a look when I'm back next week.

@bryanrsmith
Copy link
Owner

I think it would be better to roll this into the existing groupByDecorator config. You've already expanded support for that matcher in your other PR; I think we could also make it support a boolean, where true would match any decorator, and false would match no decorators.

As a tangent, the name "groupByDecorator" is also a bit inconsistent with the rest of the options. As long as we're improving it we could alias it as simply "decorator". So, { decorator: true }, or { decorator: 'bind' }.

What do you think?

@dospunk
Copy link
Contributor Author

dospunk commented May 1, 2023

I think it would be better to roll this into the existing groupByDecorator config. You've already expanded support for that matcher in your other PR; I think we could also make it support a boolean, where true would match any decorator, and false would match no decorators.

As far as I can find, the JSON Schema format doesn't support multiple types so we couldn't have groupByDecorator take a boolean or a string. We could have it check for the strings "true" and "false" to get the same functionality since they aren't valid names for decorators.

@bryanrsmith
Copy link
Owner

I think oneOf should do the trick. Something like groupByDecorator: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }

@bryanrsmith bryanrsmith merged commit c569a9b into bryanrsmith:main May 9, 2023
4 checks passed
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.

None yet

3 participants