Skip to content

Short circuit doesn't work when returning new Response(undefined) #15

@aklinker1

Description

@aklinker1

Only works in there's a request body because of this line:

` if (typeof ${resultVar}.body?.bytes === utils.FUNCTION)`,
` return ${resultVar};`,

Body is undefined, so the if-statement fails.

Simple work around:

- new Response(undefined, ...)
+ new Response("", ...)

A full instanceof Response is really slow, so I'd like a different way of detecting this consistently 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions