]> git.ardis.lu - csvio/commit
Assert non-nullable type instead of using nullish coalesce
authorArdis Lu <ardisglu@gmail.com>
Tue, 11 Feb 2025 06:41:02 +0000 (22:41 -0800)
committerArdis Lu <ardisglu@gmail.com>
Tue, 11 Feb 2025 06:41:02 +0000 (22:41 -0800)
commit5cfa86c97b64c0a7e177e258b837956dc1a5a259
tree10720f3445cb48195268b3aaf393170381a76198
parentfe3acfbc2bdf465a24ca0ffcd569b17b566040fa
Assert non-nullable type instead of using nullish coalesce

There will be undefined `decimal` only if the input to `formatToParts` does not contain a decimal. But there will always be a decimal because the input is hardcoded.

The TS language server is not yet intelligent enough to assert it is non-nullable from the hardcoded input, so we need to pass the type hint.

Using nullish coalesce results in an uncovered branch which is impossible to test, so it should be removed.
src/normalization.js
This page took 0.046439 seconds and 4 git commands to generate.