Skip to content

Fix Sonar issue: Remove redundant type assertion (typescript:S4325) #3554

@anukalp2804

Description

@anukalp2804

Summary

Sonar is reporting a code smell related to a redundant type assertion.

Rule: typescript:S4325 – Redundant casts and non-null assertions should be avoided

Sonar Issue

https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=OWASP_Nest&open=AZihbH7nrMCFFhRwcFZK

The following code uses a type assertion that does not change the effective type of the expression and is therefore unnecessary.

Affected Code

      (admin: { login: string }) => admin.login === (session as ExtendedSession)?.user?.login

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions