Skip to content

Make boolean checks explicit without changing how the app behaves [WPB-22420]#21292

Draft
screendriver wants to merge 1 commit into
devfrom
null-undefined
Draft

Make boolean checks explicit without changing how the app behaves [WPB-22420]#21292
screendriver wants to merge 1 commit into
devfrom
null-undefined

Conversation

@screendriver
Copy link
Copy Markdown
Member

@screendriver screendriver commented May 12, 2026

TaskWPB-22420 [Web] General maintenance ticket for PR merges

This change makes our code stricter and easier to reason about by removing implicit truthy/falsy checks

@screendriver screendriver changed the title Make boolean checks explicit without changing how the app behaves Make boolean checks explicit without changing how the app behaves [WPB-22420] May 12, 2026
const lookup = await maxmind.open<CountryResponse>(countryDatabasePath);
const result = lookup.get(ipAddress);
if (result) {
if (result !== undefined && result !== null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use @sindresorhus/is here?

Suggested change
if (result !== undefined && result !== null) {
if (!is.nullOrUndefined(result)) {

@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants