Skip to content

Not redacting objects that have a toJSON function #64

@random42

Description

@random42

When objects have a toJSON function redacting is not working:

const fastRedact = require('fast-redact');

const data = {
  a: 'asd',
  toJSON: () => ({
    a: 'well',
  }),
};

const s = fastRedact({
  paths: ['a'],
});

console.log(s(data));

Prints:

{"a":"well"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions