Nested functions. #3220
Digital39999
started this conversation in
General
Replies: 2 comments 2 replies
-
In that case, you can use such as following code. if (!condition) return c.json({ message: 'You are not authorized.' }, 401); Isn't it? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Implementing a feature allowing the following syntax is not a bad idea. c.status(401).json({ message: 'You are not authorized.' }) But, actually, we've never had trouble if |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any reason why status or such don't return
this
so it allows for easier nesting? I mean I get that its a little useless, but I write that if block so many times that it already annoys me because it can be nicer inline with single change. I didn't want to directly create a PR, so I'm asking here.Instead of:
to just do:
Beta Was this translation helpful? Give feedback.
All reactions