-
Notifications
You must be signed in to change notification settings - Fork 49
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
chore: align repo conventions #350
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
client/public/index.html
Outdated
function isTemplateAnnotation(str) { | ||
return ( | ||
str.indexOf("{{") === 0 && | ||
str.lastIndexOf("}}") === str.length - 2 |
Check failure
Code scanning / CodeQL
Incorrect suffix check High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 5 days ago
To fix the problem, we need to explicitly check if lastIndexOf
returns -1 before comparing it to str.length - 2
. This ensures that the function correctly identifies when the substring "}}"
is not found in str
.
- Modify the
isTemplateAnnotation
function to include a check forlastIndexOf
returning -1. - Update the condition to ensure it only returns true if the substring
"}}"
is found at the correct position.
-
Copy modified line R31
@@ -30,2 +30,3 @@ | ||
str.indexOf("{{") === 0 && | ||
str.lastIndexOf("}}") !== -1 && | ||
str.lastIndexOf("}}") === str.length - 2 |
No description provided.