Skip to content

Commit 884657d

Browse files
thst71dougwilson
authored andcommitted
examples: remove bitwise syntax for includes check
closes #4814
1 parent 7511d08 commit 884657d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: examples/web-service/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ app.use('/api', function(req, res, next){
3434
if (!key) return next(error(400, 'api key required'));
3535

3636
// key is invalid
37-
if (!~apiKeys.indexOf(key)) return next(error(401, 'invalid api key'));
37+
if (apiKeys.indexOf(key) === -1) return next(error(401, 'invalid api key'))
3838

3939
// all good, store req.key for route access
4040
req.key = key;

0 commit comments

Comments
 (0)