deno_std
deno_std copied to clipboard
refactor(yaml): cleanup `stringifyFlowMapping()`
Codecov Report
Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
Project coverage is 96.25%. Comparing base (
c817a5a) to head (eaa0ba9). Report is 11 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| yaml/_dumper_state.ts | 75.00% | 3 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #5743 +/- ##
==========================================
+ Coverage 96.23% 96.25% +0.01%
==========================================
Files 480 480
Lines 38748 38736 -12
Branches 5616 5614 -2
==========================================
- Hits 37291 37285 -6
+ Misses 1416 1410 -6
Partials 41 41
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Frankly, I don't really see the purpose behind this PR.
There are several (tiny) performance benefits:
quoteandseparatorare take out of the loop, therefore only need one checkstringifyNode()for key and value is called at the beginning of the loop, thus continues the loop beforepairBufferis even initialized.- there is no
index !== 0check, because the values are joined afterwards
It also is more readable imo and half the lines.