Skip to content

Conversation

@davegregg
Copy link
Contributor

@davegregg davegregg commented Jan 31, 2025

Summary

Fix 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:
change: Infinity,

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'.

Resolves issue 32278

…hich ought to be hit when there is no matching base artifact.
@poteto
Copy link
Member

poteto commented Jan 31, 2025

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants