Provide an empty array as the first argument for the PolymorphicSerializer.serialize function
Expected behavior*
When providing an empty array to the polymorphic serializer serialize function an unhandled type error is thrown:
Reduce of empty array with no initial value
Platform*
[ ] OS: macOS - Sonoma 14.3.1
[ ] Browser N/A
[ ] Version: 1.11.0
Additional context
Stack:
TypeError: Reduce of empty array with no initial value
at Array.reduce (<anonymous>)
at PolymorphicSerializer.serialize (/ts-japi@1.11.0/node_modules/ts-japi/lib/classes/polymorphic-serialiser.js:20:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
message: 'Reduce of empty array with no initial value'
Describe the bug*
When
To Reproduce*
Provide an empty array as the first argument for the
PolymorphicSerializer.serialize
functionExpected behavior*
When providing an empty array to the polymorphic serializer
serialize
function an unhandled type error is thrown:Reduce of empty array with no initial value
Platform*
Additional context
Stack: