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

Add globstar (wildcard deep matching) support #1216

Merged
merged 3 commits into from
Mar 5, 2023
Merged

Conversation

gustavohenke
Copy link
Member

@gustavohenke gustavohenke commented Mar 5, 2023

In a nutshell, any field paths with ** will now be considered a wildcard that can deeply match fields.

For example:

Input path Input object Selected fields
** { a: { foo: 1, bar: 2 }, b: { c: { d: { e: 3 } } } } a.foo, a.bar, b.c.d.e
**.foo { a: { foo: 1, bar: 2 }, b: { c: { foo: 3 } }, foo: 4 } a.foo, b.c.foo, foo

Works with both check() + variants, and checkExact().

Fixes #1137

@coveralls
Copy link

Coverage Status

Coverage: ?%. Remained the same when pulling 4d898a7 on v7-globstar into 6c6ea73 on v7-features.

@coveralls
Copy link

Coverage Status

Coverage: 100.0%. Remained the same when pulling 4d898a7 on v7-globstar into 6c6ea73 on v7-features.

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.

Is there a way to escape all values in a nested object when the keys are unknown?
2 participants