denoland / deno_std

The Deno Standard Library
https://jsr.io/@std
MIT License
2.83k stars 581 forks source link

refactor(yaml): simplify map initializations #5183

Closed kt3k closed 4 days ago

kt3k commented 4 days ago

This PR makes tagMap and anchorMap properties non-nullable. These 2 properties are assigned with Object.create(null) nearly the beginning of their usages, but not initialized in the constructor. That causes them nullable types, and makes the logic unnecessarily complex. This PR removes those complexities.

codecov[bot] commented 4 days ago

Codecov Report

Attention: Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 93.82%. Comparing base (de998e7) to head (1ef6bca). Report is 2 commits behind head on main.

Files Patch % Lines
yaml/_loader/loader.ts 10.00% 7 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5183 +/- ## ========================================== + Coverage 93.77% 93.82% +0.05% ========================================== Files 469 469 Lines 37917 37894 -23 Branches 5449 5439 -10 ========================================== - Hits 35557 35555 -2 + Misses 2317 2295 -22 - Partials 43 44 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.