Commit d37d464
refactor: simplify toPreviewText by removing redundant branches
Array.prototype.join already calls String() on non-nullish elements, so
the .map() was identity after .filter(). The typeof string fast path
returned the same result as the trailing String(text), so it was a no-op
too. Four branches collapse to three with identical behavior.
Side benefit: return String(text) is now the path strings take, fixing
the Codecov uncovered-line flag.
Addresses review feedback:
#14073 (comment)1 parent db5abec commit d37d464
1 file changed
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | 70 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 71 | + | |
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
| |||
0 commit comments