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

Fixed: Error is thrown for wildcard paths vs object with nested nulls #47

Conversation

kostya-luxuryescape
Copy link
Contributor

As per title the following error was thrown when I was using path with multiple wildcards against an object with nulls

TypeError: Cannot use 'in' operator to search for 'x' in null
at specialSet (/workspace/lib-logger/node_modules/fast-redact/lib/modifiers.js:120:53)
at nestedRedact (/workspace/lib-logger/node_modules/fast-redact/lib/modifiers.js:73:7)
   const redact = fastRedact({
      paths: ['*.*.x'],
      serialize: false,
      censor: "[REDACTED]",
    });

    expect(redact({a: {b: null}})).toEqual({a: {b: null}});

Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit ab8f7cb into davidmarkclements:main Feb 23, 2022
@kostya-luxuryescape kostya-luxuryescape deleted the fix_multi_wildcards_vs_objects_with_nulls branch February 23, 2022 23:52
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