Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Polymorphic Serialiser - Not handling empty arrays #86

Closed
3 tasks
janders4 opened this issue Apr 18, 2024 · 0 comments
Closed
3 tasks

[BUG] Polymorphic Serialiser - Not handling empty arrays #86

janders4 opened this issue Apr 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@janders4
Copy link
Contributor

Describe the bug*

When

To Reproduce*

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 (/[email protected]/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'
@janders4 janders4 added the bug Something isn't working label Apr 18, 2024
@egmacke egmacke assigned egmacke and unassigned jrandolf Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants