Skip to content

Clear up remaining truthiness issues. - #839

Open
jdmarshall wants to merge 1 commit into
prometheus:mainfrom
jdmarshall:truthiness
Open

jdmarshall wants to merge 1 commit into
prometheus:mainfrom
jdmarshall:truthiness

Conversation

@jdmarshall

Copy link
Copy Markdown
Contributor

This issue has gotten great contributions from the community but a few have been overlooked, particularly in the tests.

Clearing up the rest so that code tools stop complaining.

This should be a slight performance improvement over a handful of code paths.

Fixes prometheus#823

Signed-off-by: Jason Marshall <jdmarshall@users.noreply.github.com>
@jdmarshall jdmarshall changed the title Clear up remaining type coercion issues. Clear up remaining truthiness issues. Sep 9, 2026
Comment thread lib/metric.js
);
}

if (this.collect && typeof this.collect !== 'function') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be also changed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that one. The use of nullish values in constructors shows up in the tests and so I suspect some people must be using it in their code. But passing 0 in could cause some chicanery.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants