superstruct
superstruct copied to clipboard
Allow frozen objects/arrays to be coerced
The Bug
The issue was the mutation of the input object/array while coercing entries inside the run util -- combined with a missing custom coercer which would clone its input (exactly as @gwisp2 suggested in #1096).
Apart from record, tuple was also affected by the same potential issue.
PR Changes
- Added coercer that clones its input to
recordandtuple. - Added tests with frozen objects for all structs which could potentially be affected (object/array based and include entries).
Resolves #1096