davidmarkclements / fast-redact

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

Update validator to remove Node vm dependency #53

Closed mikehw closed 1 year ago

mikehw commented 1 year ago

Removing vm references and replacing the validation code with a Function eval.

This change should enable the use of fast-redact in browsers and Deno.

Addresses issue #37

mcollina commented 1 year ago

Why would you do this?

mikehw commented 1 year ago

I would like to use fast-redact in a Deno project, but Deno currently does not support vm.

While the code running has access to the parent scope it should have no side effects, and vm should not be used as a security mechanism per the node documentation. Related Article

mcollina commented 1 year ago

I don't think vm is actually needed here.