Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function createHandle (stack: Stack, options: AppOptions): PHandle {
const type = typeof val
if (type === 'string') {
return send(res, val, MIMES.html)
} else if (type === 'object' && val !== undefined) {
} else if (['bigint', 'number', 'boolean', 'object'].includes(type)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For maximum performance, we could avoid iteration and add 4 == checks.

// Return 'false' and 'null' values as JSON strings
if (val && val.buffer) {
return send(res, val)
Expand Down