protobuf-ts
protobuf-ts copied to clipboard
Make repeated field merging consistent
This addresses https://github.com/timostamm/protobuf-ts/discussions/319
Setup
const source = { bars: [1], foos: [{ foo: 1 }] };
const target = { bars: [2, 3], foos: [{ foo: 2 }, { foo: 3 }] };
reflectionMergePartial(SomeMessageType, target, source);
Before PR
Repeated Field | Scalar/Enum | Message |
---|---|---|
result target array is referentially equal to original target array | :x: | :white_check_mark: |
result target array is deeply equal to source array | :white_check_mark: | :x: |
result target array is NOT referentially equal to source array | :white_check_mark: | :white_check_mark: |
After PR
Repeated Field | Scalar/Enum | Message |
---|---|---|
result target array is referentially equal to original target array | :white_check_mark: | :white_check_mark: |
result target array is deeply equal to source array | :white_check_mark: | :white_check_mark: |
result target array is NOT referentially equal to source array | :white_check_mark: | :white_check_mark: |