Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/utils/getPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
// remove comments
if (line.startsWith("#")) return

return line.replace(/(\/)/g, "\\/").replace(/(\*)/g, "(.*)")
return line
.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")

Check warning on line 22 in scripts/utils/getPackages.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

`String.raw` should be used to avoid escaping `\`.

See more on https://sonarcloud.io/project/issues?id=ragestudio_comty&issues=AZ-uJC5Y85lIvTuuxlsU&open=AZ-uJC5Y85lIvTuuxlsU&pullRequest=368
.replace(/\\\*/g, "(.*)")

Check warning on line 23 in scripts/utils/getPackages.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `String#replaceAll()` over `String#replace()`.

See more on https://sonarcloud.io/project/issues?id=ragestudio_comty&issues=AZ-uJC5Y85lIvTuuxlsV&open=AZ-uJC5Y85lIvTuuxlsV&pullRequest=368
}).filter((line) => line)

// filter packages that are in the gitignore file
Expand Down