davidmarkclements / fast-redact

very fast object redaction
MIT License
284 stars 30 forks source link

Should restore original object when the first call is precensored #29

Closed adrianolek closed 3 years ago

adrianolek commented 4 years ago

When the first call has the redacted property value equal the censor value, then subsequent calls will not restore the redacted property in the original object.

I've created a test case, please have a look:

https://github.com/adrianolek/fast-redact/blob/first-call-precensored/test/index.js#L292

Started in https://github.com/pinojs/pino/issues/919

mcollina commented 4 years ago

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

lukehedger commented 3 years ago

@mcollina I've opened PR https://github.com/davidmarkclements/fast-redact/pull/38 to address this issue, with the test case already created by @adrianolek.