prometheus / prometheus/client_js
Truthiness Reduction Program 2026
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.5k
- Forks
- 429
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 22
Description
A number of PRs have reduced or removed truthiness checks over time, particularly once nullish operators were added to the code. Truthy checks force object coercion, which is both extra clock cycles and additional GC overhead. Even if there aren't many of these left on hot paths, there are for sure a few and the rest still hurt, just not as much. Also nullish and coalescing operators all date back to 14 (one is on 16 but I can't recall which) and we support >=20 so it's overdue.
If anyone would like to do a PR to remove most of the rest, I'd like to see that. Please however be aware of the existing open PRs as merge conflicts slow the review process down more than just about anything else.
Don't forget to look for ternary operators. There are a few hiding there.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for remaining truthiness checks and ternary operators, then review the existing open PRs before choosing a scope. Focus on checks that can use nullish operators without changing behavior, while avoiding overlapping edits that could create merge conflicts. Done means the selected reductions are applied consistently and remain compatible with the supported Node.js versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- observability-sre
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100