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/improved exclude keys matching #246

Merged
merged 5 commits into from
Feb 21, 2024
Merged

Conversation

mrodrig
Copy link
Owner

@mrodrig mrodrig commented Feb 17, 2024

Background Information

I have...

  • added at least one test to verify the failure condition is fixed.
  • verified the tests are passing.

This will allow for the filtering of keys nested underneath a specific key prefix, such as the use case of not wanting to include the keys present in an array when `expandArrayObjects` is set to `true`. This addresses the use case presented in #244.
@mrodrig mrodrig added this to the 5.1.0 milestone Feb 17, 2024
@coveralls
Copy link

coveralls commented Feb 17, 2024

Coverage Status

coverage: 97.906% (+0.02%) from 97.884%
when pulling e18d66c on feat/improved-excludeKeys-matching
into 7b32338 on main.

…the start of a string

In a case where `excludeKeys` is set to `["arr"]`, there was a possibility that with JSON data looking like this:

```
[
    {
        "id": 1,
        "arr": [
            {
                "name": "foo"
            }
        ],
        "name": {
            "arr": "this should appear"
        }
    },
    {
        "id": 2,
        "arr": [
            {
                "name": "bar"
            }
        ],
        "name": {
            "arr": "this should also appear"
        }
    }
]
```

could potentially result in both `arr.name` and `name.arr` being excluded. By adjusting the RegExp thats being used for the matching, this fixes a potential bug that caused `name.arr` to be mistakenly excluded.
@mrodrig mrodrig merged commit 8062ef2 into main Feb 21, 2024
9 checks passed
@mrodrig mrodrig deleted the feat/improved-excludeKeys-matching branch February 21, 2024 04:02
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.

2 participants