There is a typo in dangerfile.js which results in an unreachable code path which ought to be hit when there is no matching base artifact during DangerCI automated code review.
See:
|
if (Number === Infinity) { |
Compare:
And the case which should hit this code path:
|
// There's no matching base artifact. This is a new file. |
Given the above context, the condition Number === Infinity is clearly meant to be decimal === Infinity, which it will be if the catch statement triggers when there is no matching base artifact. Without this fix, the primitive value Infinity is passed to percentFormatter.format(decimal), resulting in the string '+∞%'. With this fix, the resulting string will be the intended 'New file'.
There is a typo in dangerfile.js which results in an unreachable code path which ought to be hit when there is no matching base artifact during DangerCI automated code review.
See:
react/dangerfile.js
Line 73 in 221f300
Compare:
react/dangerfile.js
Line 171 in 221f300
And the case which should hit this code path:
react/dangerfile.js
Line 160 in 221f300
Given the above context, the condition
Number === Infinityis clearly meant to bedecimal === Infinity, which it will be if thecatchstatement triggers when there is no matching base artifact. Without this fix, the primitive valueInfinityis passed topercentFormatter.format(decimal), resulting in the string'+∞%'. With this fix, the resulting string will be the intended'New file'.PR 32277 resolves this