davidmarkclements / fast-redact

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

restore on nested object fails at `o.flat === true` check because ` Object.keys(secret)` some how returns empty string key #30

Open ilovett opened 3 years ago

ilovett commented 3 years ago

I'm not sure why but my secret object has an empty string property "": null

So on redact.restore, this line fails if (o.flat === true) this.groupRestore(o)

Happens when paths have '*.item', 'item',

mcollina commented 3 years ago

could you please include a runnable example to reproduce?