Skip to content

Commit 2e733bd

Browse files
committed
Avoid loose string comparisons
The `===` form is much safer than `==`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 774b98e commit 2e733bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

GitForWindowsHelper/slash-commands.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = async (context, req) => {
4949
const thumbsUp = async () => react('+1')
5050

5151
try {
52-
if (command == '/open pr') {
52+
if (command === '/open pr') {
5353
if (owner !== 'git-for-windows' || !['git', 'msys2-runtime'].includes(repo)) return `Ignoring ${command} in unexpected repo: ${commentURL}`
5454

5555
await checkPermissions()
@@ -111,7 +111,7 @@ module.exports = async (context, req) => {
111111
return `I edited the comment: ${commentURL}`
112112
}
113113

114-
if (command == '/updpkgsums') {
114+
if (command === '/updpkgsums') {
115115
if (owner !== 'git-for-windows'
116116
|| !req.body.issue.pull_request
117117
|| !['build-extra', 'MINGW-packages', 'MSYS2-packages'].includes(repo)) {
@@ -265,7 +265,7 @@ module.exports = async (context, req) => {
265265
return `I edited the comment: ${answer.html_url}`
266266
}
267267

268-
if (command == '/git-artifacts') {
268+
if (command === '/git-artifacts') {
269269
if (owner !== 'git-for-windows'
270270
|| repo !== 'git'
271271
|| !req.body.issue.pull_request
@@ -367,7 +367,7 @@ module.exports = async (context, req) => {
367367
}
368368
}
369369

370-
if (command == '/release') {
370+
if (command === '/release') {
371371
if (owner !== 'git-for-windows'
372372
|| repo !== 'git'
373373
|| !req.body.issue.pull_request

0 commit comments

Comments
 (0)