davidmarkclements / fast-redact

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

Pass strings through wildcard key redaction #32

Closed 72636c closed 6 months ago

72636c commented 3 years ago

Per #31, we currently throw a TypeError when we try to apply a wildcard key redaction configuration to a string target. Strings spoofed themselves into an object code path due to gotchas like:

Object.keys('string')
// => [ '0', '1', '2', '3', '4', '5' ]

We already bail early on nullish targets, so we can extend this behaviour to cover string targets as well. Other primitives are already handled safely but I've added tests to cover them off.

72636c commented 3 years ago

Unrelated to this change, it looks like CI is failing on Node.js 6 due to a new tap > bind-obj-methods@2.0.1 patch version using an object literal spread.

If we want to keep Node.js 6 compatibility we can try locking that dependency to v2.0.0.

72636c commented 3 years ago

cc @mcollina, if you have a moment to review 🙇

P4sca1 commented 7 months ago

@davidmarkclements Is there anything else that needs to be done so that this can get merged and released? Do you need help with anything?