By nested DeepImmutable or directly passing ReadonlyArray and ReadonlyMap to DeepImmutable and Immutable types results in DeepImmutableObject<ReadonlyArray> and DeepImmutableObject<ReadonlyMap> which should be neutralized by the type itself.
Steps to reproduce
For ReadonlyArray:
type A = DeepImmutable<DeepImmutable<string[]>>
For ReadonlyMap:
type B = DeepImmutable<DeepImmutable<Map<'key', 'value'>>>
Summary
By nested
DeepImmutable
or directly passingReadonlyArray
andReadonlyMap
toDeepImmutable
andImmutable
types results inDeepImmutableObject<ReadonlyArray>
andDeepImmutableObject<ReadonlyMap>
which should be neutralized by the type itself.Steps to reproduce
For
ReadonlyArray
:For
ReadonlyMap
:Expected result(s)
For
ReadonlyArray
:For
ReadonlyMap
:Actual result(s)
For
ReadonlyArray
:For
ReadonlyMap
:Solution
Add conditions to check
ReadonlyArray
andReadonlyMap
inDeepImmutable
andImmutable
types.