Skip to content

Commit 37b960a

Browse files
committed
Fix jshint errors.
1 parent eb158c3 commit 37b960a

File tree

4 files changed

+32
-29
lines changed

4 files changed

+32
-29
lines changed

src/cli.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,25 @@ function init() {
4545
);
4646
process.exit(2);
4747
}
48-
};
48+
}
4949

5050
function cli(inputArgs) {
5151

5252
var knownOpts =
53-
{ 'version' : Boolean
54-
, 'help' : Boolean
55-
, 'verbose' : Boolean
56-
, 'exit' : Boolean
57-
, 'use-gdb' : Boolean
58-
, 'uuid' : String
59-
, 'env' : String
60-
, 'setenv' : String
61-
, 'stdout' : path
62-
, 'stderr' : path
63-
, 'timeout' : Number
64-
, 'args' : Array
65-
, 'devicetypeid' : String
53+
{
54+
'version' : Boolean,
55+
'help' : Boolean,
56+
'verbose' : Boolean,
57+
'exit' : Boolean,
58+
'use-gdb' : Boolean,
59+
'uuid' : String,
60+
'env' : String,
61+
'setenv' : String,
62+
'stdout' : path,
63+
'stderr' : path,
64+
'timeout' : Number,
65+
'args' : Array,
66+
'devicetypeid' : String
6667
};
6768

6869
var shortHands = null;

src/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var command_lib = {
7575
start : function(args) {
7676
lib.start(args.devicetypeid);
7777
}
78-
}
78+
};
7979

8080
module.exports = command_lib;
8181

src/help.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function help() {
3535
} else {
3636
console.log("Help file missing.");
3737
}
38-
};
38+
}
3939

4040
module.exports = help;
4141

src/lib.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function getDeviceFromDeviceTypeId(devicetypeid) {
168168

169169
// check whether devicetype has the "com.apple.CoreSimulator.SimDeviceType." prefix, if not, add it
170170
var prefix = 'com.apple.CoreSimulator.SimDeviceType.';
171-
if (devicetype.indexOf(prefix) != 0) {
171+
if (devicetype.indexOf(prefix) !== 0) {
172172
devicetype = prefix + devicetype;
173173
}
174174

@@ -261,18 +261,19 @@ var lib = {
261261
name_id_map[ device.name ] = device.id;
262262
});
263263

264-
var list = [];
264+
list = [];
265+
var remove = function(runtime){
266+
// remove "iOS" prefix in runtime, remove prefix "com.apple.CoreSimulator.SimDeviceType." in id
267+
list.push(util.format("%s, %s", name_id_map[ deviceName ].replace(/^com.apple.CoreSimulator.SimDeviceType./, ''), runtime.replace(/^iOS /, '')));
268+
};
269+
265270
for (var deviceName in druntimes) {
266271
var runtimes = druntimes[ deviceName ];
267272

268273
if (!(deviceName in name_id_map)) {
269274
continue;
270275
}
271-
272-
runtimes.forEach(function(runtime){
273-
// remove "iOS" prefix in runtime, remove prefix "com.apple.CoreSimulator.SimDeviceType." in id
274-
list.push(util.format("%s, %s", name_id_map[ deviceName ].replace(/^com.apple.CoreSimulator.SimDeviceType./, ''), runtime.replace(/^iOS /, '')));
275-
});
276+
runtimes.forEach(remove);
276277
}
277278
return list;
278279
},
@@ -288,17 +289,18 @@ var lib = {
288289
name_id_map[ device.name ] = device.id;
289290
});
290291

292+
var remove = function(runtime){
293+
// remove "iOS" prefix in runtime, remove prefix "com.apple.CoreSimulator.SimDeviceType." in id
294+
console.log(util.format("%s, %s", name_id_map[ deviceName ].replace(/^com.apple.CoreSimulator.SimDeviceType./, ''), runtime.replace(/^iOS /, '')));
295+
};
296+
291297
for (var deviceName in druntimes) {
292298
var runtimes = druntimes[ deviceName ];
293299

294300
if (!(deviceName in name_id_map)) {
295301
continue;
296302
}
297-
298-
runtimes.forEach(function(runtime){
299-
// remove "iOS" prefix in runtime, remove prefix "com.apple.CoreSimulator.SimDeviceType." in id
300-
console.log(util.format("%s, %s", name_id_map[ deviceName ].replace(/^com.apple.CoreSimulator.SimDeviceType./, ''), runtime.replace(/^iOS /, '')));
301-
});
303+
runtimes.forEach(remove);
302304
}
303305
},
304306

@@ -397,7 +399,7 @@ var lib = {
397399

398400
simctl.extensions.start(device.id);
399401
}
400-
}
402+
};
401403

402404
module.exports = lib;
403405

0 commit comments

Comments
 (0)