perf(request): allocate `#validatedData` lazily (#5175)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
The constructor allocated `#validatedData = {}` on every `HonoRequest`, so every request paid for the validator feature whether or not any validator ran. It is now created on the first `addValidatedData()` call. `valid()` reads through optional chaining and still returns `undefined` for targets that were never validated, as before.
authored by Igor Savin · committed by Yusuke Wada · parent 3fbbd96 · Browse files · 1 file+3 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+3 added−4 removed
- other:+3 added−4 removed