Skip to content

Conversation

@crockalet
Copy link

…a function

Description

Converted FormData entries iterator to an array before reduce to avoid reduce is not a function and keep request body parsing stable.

Related Issue

#170

Context

getFormDataEntries() can return an iterator in some environments, which does not implement reduce. Converting to an array fixes the runtime error while preserving existing behavior.

Testing

--

@vercel
Copy link

vercel bot commented Jan 25, 2026

@crockalet is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@V3RON V3RON left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it!
I'm going to bring it into main soon.

Comment on lines +50 to +52
const entriesArray = (
Array.isArray(entries) ? entries : Array.from(entries || [])
) as Array<[string, unknown]>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to check whether entries is an array. Array.from will simply return a copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants