Skip to content

Conversation

@Nerivec
Copy link
Collaborator

@Nerivec Nerivec commented Jul 18, 2025

No description provided.

@Nerivec Nerivec requested a review from Copilot July 18, 2025 14:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR performs minor code cleanup in the utils.ts file by improving code consistency and removing linter suppressions. The changes focus on consolidating conditional logic and standardizing parameter handling patterns.

  • Refactored conditional checks to use early returns for better readability
  • Removed parameter reassignment by using inline ternary expressions
  • Updated biome-ignore comments to be more descriptive

src/lib/utils.ts Outdated
// biome-ignore lint/suspicious/noExplicitAny: ignored using `--suppress`
// biome-ignore lint/suspicious/noExplicitAny: generic object
export function isObject(value: unknown): value is {[s: string]: any} {
return typeof value === "object" && !Array.isArray(value);
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

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

The isObject function doesn't check for null values, which means null will return true since typeof null === "object". This is inconsistent with the assertObject function which explicitly excludes null. Add && value !== null to maintain consistency.

Suggested change
return typeof value === "object" && !Array.isArray(value);
return typeof value === "object" && value !== null && !Array.isArray(value);

Copilot uses AI. Check for mistakes.
@Koenkk Koenkk merged commit 5373958 into Koenkk:master Jul 18, 2025
3 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jul 18, 2025

Thanks!

@Nerivec Nerivec deleted the cleanup branch July 18, 2025 18:54
SimplaHome pushed a commit to SimplaHome/zigbee-herdsman-converters that referenced this pull request Aug 15, 2025
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