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
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