mirror of
https://github.com/openstf/stf
synced 2025-10-05 19:42:01 +02:00
Fix all JSHint complaints in Node.js code.
This commit is contained in:
parent
f62ce4acc1
commit
b4416b5f0f
31 changed files with 126 additions and 119 deletions
|
@ -1,4 +1,3 @@
|
|||
var url = require('url')
|
||||
var http = require('http')
|
||||
var events = require('events')
|
||||
var path = require('path')
|
||||
|
@ -41,7 +40,8 @@ module.exports = function(options) {
|
|||
|
||||
app.use(cors())
|
||||
|
||||
app.use('/static/bower_components', express.static(pathutil.resource('bower_components')))
|
||||
app.use('/static/bower_components',
|
||||
express.static(pathutil.resource('bower_components')))
|
||||
app.use('/static/data', express.static(pathutil.resource('data')))
|
||||
app.use('/static/devices', datautil.middleware())
|
||||
app.use('/static', express.static(pathutil.resource('app')))
|
||||
|
@ -203,7 +203,7 @@ module.exports = function(options) {
|
|||
accept(null, false)
|
||||
}
|
||||
})
|
||||
.catch(function(err) {
|
||||
.catch(function() {
|
||||
accept(null, false)
|
||||
})
|
||||
}
|
||||
|
@ -225,11 +225,11 @@ module.exports = function(options) {
|
|||
sub.unsubscribe(channel)
|
||||
}
|
||||
|
||||
function createTouchHandler(klass) {
|
||||
function createTouchHandler(Klass) {
|
||||
return function(channel, data) {
|
||||
push.send([
|
||||
channel
|
||||
, wireutil.envelope(new klass(
|
||||
, wireutil.envelope(new Klass(
|
||||
data.x
|
||||
, data.y
|
||||
))
|
||||
|
@ -237,11 +237,11 @@ module.exports = function(options) {
|
|||
}
|
||||
}
|
||||
|
||||
function createKeyHandler(klass) {
|
||||
function createKeyHandler(Klass) {
|
||||
return function(channel, data) {
|
||||
push.send([
|
||||
channel
|
||||
, wireutil.envelope(new klass(
|
||||
, wireutil.envelope(new Klass(
|
||||
data.key
|
||||
))
|
||||
])
|
||||
|
@ -309,7 +309,7 @@ module.exports = function(options) {
|
|||
// User's private group
|
||||
joinChannel(user.group)
|
||||
|
||||
new Promise(function(resolve, reject) {
|
||||
new Promise(function(resolve) {
|
||||
socket.on('disconnect', resolve)
|
||||
// Touch events
|
||||
.on('input.touchDown', createTouchHandler(wire.TouchDownMessage))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue