Closed arb closed 4 years ago
Merging #168 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #168 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 64 62 -2
Branches 12 11 -1
=====================================
- Hits 64 62 -2
Impacted Files | Coverage Δ | |
---|---|---|
lib/index.js | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update b423571...f651615. Read the comment docs.
After staring at the main validation path for a few hours, I realized a lot of this code is more complex than it really needed to be.
Biggest changes:
validateBody
to be a closure to keep a curried copy ofvalidateSegment
around so we only need to create this once.[].reduce(() =>{}, Promise.resolve(null)
rather than the recursive way it used to be.celebrate()
not every time the request is validatedBenchmarks
These values come from
node utils/benchmark
:pre-change
after-change
Unless I'm doing something incredibly wrong, that's an order of magnitude faster 😮