hono
hono copied to clipboard
Using `every` + `except` doesn't work as expected. `4.6.3`
What version of Hono are you using?
4.6.3
What runtime/platform is your app running on?
Node
What steps can reproduce the bug?
Just this piece of code for the middleware
const middleware = every(
except(_ => true, // True means it won't run 🛑
() => {
console.log("1st middleware ran");
}),
except(_ => false, // False means it WILL run ✅
() => {
console.log("2nd middleware ran");
})
);
But the output will still be:
1st middleware ran
2nd middleware ran
I don't understand... Why did 1st middleware run even when its "except" is true
?
Also, the only case that the first middleware won't run is when both are true
.
What is the expected behavior?
Only 2nd will run, and 1st won't.
What do you see instead?
No response
Additional information
No response