These changes are fixing the problem with original object being left mutated after restore execution. It was happening after more than one usage of redact function.
Compiled restore function now always pointing to the latest "secret" state.
Fixed test "does not increment secret size". Previously it was always testing the origin "secret" object, not the restored one, so in general generating false positive.
Extended test: "restores multi nested wildcard values" to cover multiple redact-restore executions.
These changes are fixing the problem with original object being left mutated after restore execution. It was happening after more than one usage of redact function. Compiled restore function now always pointing to the latest "secret" state. Fixed test "does not increment secret size". Previously it was always testing the origin "secret" object, not the restored one, so in general generating false positive. Extended test: "restores multi nested wildcard values" to cover multiple redact-restore executions.