-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: "The ?? operator will always return the left operand" in SupabaseClient.ts #1338
Comments
Nice catch @leongobbs! Would you like to submit a PR for this? |
Hi @j4w8n, Thank you for your response! I’d be happy to submit a PR, but it might take me some time to get to it. In the meantime, here’s a brief guide on how to fix the issue in case someone else wants to address it: Instructions to Fix the Issue:
Let me know if you'd like me to clarify anything! If no one addresses it before I get a chance, I’ll work on the PR myself. Thanks again! 😊 |
Thanks, @leongobbs. Whenever you get to it; or if someone else would like to tackle this as a "first good issue," that works too. If enough time goes by without a PR, I or a maintainer will take care of it. |
…nHeader fixes the following bug : The left operand of the "??" operator here will never be null or undefined, so it will always be returned. supabase#1338
I encountered a warning while using
[email protected]
with Deno. The warning states that the??
operator will always return the left operand because the left-hand expression can never benull
orundefined
. This seems to be unnecessary usage of the??
operator.Here’s the exact warning:
Steps to Reproduce:
supabase-js
in a Deno project:Run the project in Deno with the following command:
Observe the warning in the terminal.
Expected Behavior:
No warning should be emitted, as this seems like an unnecessary check.
Actual Behavior:
The following warning is displayed in the terminal:
Proposed Fix:
It seems that the nullish coalescing operator (
?? false
) can be removed in this case since'Authorization' in this.headers
will always return a boolean (true
orfalse
).The current code:
Suggested fix:
Environment:
[email protected]
1.37.0
Additional Context:
This warning does not break functionality but clutters the logs during development.
The text was updated successfully, but these errors were encountered: