denoland / deno_std

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

refactor(yaml): cleanup `detectType()` #5313

Closed timreichen closed 2 days ago

timreichen commented 2 days ago

Note: The if statement conditions seemed very odd. I am not sure, if the new conditions reflect the original. Please check.

codecov[bot] commented 2 days ago

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.80%. Comparing base (59f5708) to head (c90cf27).

Files Patch % Lines
yaml/_dumper.ts 72.72% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5313 +/- ## ========================================== - Coverage 95.81% 95.80% -0.01% ========================================== Files 458 458 Lines 37854 37851 -3 Branches 5563 5562 -1 ========================================== - Hits 36268 36263 -5 - Misses 1546 1548 +2 Partials 40 40 ```

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

kt3k commented 2 days ago

instanceOf seems used from only 1 type (timestamp). Maybe we can replace it with predicate