Skip to content

Commit d6ca375

Browse files
authored
Merge pull request #192 from BranchMetrics/style/fix-syntax
Style/fix syntax
2 parents aab303f + f0d3bfe commit d6ca375

File tree

16 files changed

+188
-196
lines changed

16 files changed

+188
-196
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ testbed/plugins
44
testbed/hooks
55
node_modules
66
testbed/ul_web_hooks/
7-
.installed
7+
.installed
8+
9+
tests
10+
www
11+
hooks
12+
testbed/www/js

gulpfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ gulp.task('lint', [ 'eslint', 'jscs-lint' ]);
121121
var srcs = [
122122
'**/*.js',
123123
'!node_modules/**',
124-
'!testbed/platforms/ios/cordova/node_modules/**'
124+
'!testbed/platforms/**',
125+
'!testbed/plugins/**',
126+
'!tests-harness/platforms/**',
127+
'!tests-harness/plugins/**'
125128
];
126129

127130
gulp.task('eslint', () => {

hooks/afterPrepareHook.js renamed to hooks.es6/afterPrepareHook.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ function run(cordovaContext) {
3939

4040
platformsList.forEach(function(platform) {
4141
switch (platform) {
42-
case ANDROID:
43-
{
42+
case ANDROID: {
4443
activateUniversalLinksInAndroid(cordovaContext, pluginPreferences);
4544
break;
4645
}
47-
case IOS:
48-
{
46+
case IOS: {
4947
activateUniversalLinksInIos(cordovaContext, pluginPreferences);
5048
break;
5149
}
File renamed without changes.

hooks/lib/android/manifestWriter.js renamed to hooks.es6/lib/android/manifestWriter.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Class injects plugin preferences into AndroidManifest.xml file.
104104

105105
var action = actions[0]['$']['android:name'];
106106

107-
return ('android.intent.action.VIEW' === action);
107+
return action === 'android.intent.action.VIEW';
108108
}
109109

110110
/**
@@ -126,11 +126,11 @@ Class injects plugin preferences into AndroidManifest.xml file.
126126
categories.forEach(function(category) {
127127
var categoryName = category['$']['android:name'];
128128
if (!isBrowsable) {
129-
isBrowsable = 'android.intent.category.BROWSABLE' === categoryName;
129+
isBrowsable = categoryName === 'android.intent.category.BROWSABLE';
130130
}
131131

132132
if (!isDefault) {
133-
isDefault = 'android.intent.category.DEFAULT' === categoryName;
133+
isDefault = categoryName === 'android.intent.category.DEFAULT';
134134
}
135135
});
136136

@@ -237,8 +237,8 @@ Class injects plugin preferences into AndroidManifest.xml file.
237237
return false;
238238
}
239239

240-
var isMainAction = ('android.intent.action.MAIN' === action[0]['$']['android:name']),
241-
isLauncherCategory = ('android.intent.category.LAUNCHER' === category[0]['$']['android:name']);
240+
var isMainAction = (action[0]['$']['android:name'] === 'android.intent.action.MAIN'),
241+
isLauncherCategory = (category[0]['$']['android:name'] === 'android.intent.category.LAUNCHER');
242242

243243
return isMainAction && isLauncherCategory;
244244
});
@@ -256,30 +256,30 @@ Class injects plugin preferences into AndroidManifest.xml file.
256256
*/
257257
function createIntentFilter(host, scheme, pathPrefix, androidM) {
258258
var intentFilter = {
259-
'$' : {
259+
'$': {
260260
'android:autoVerify': 'true'
261261
},
262-
'action': [{
262+
'action': [ {
263263
'$': {
264264
'android:name': 'android.intent.action.VIEW'
265265
}
266-
}],
267-
'category': [{
266+
} ],
267+
'category': [ {
268268
'$': {
269269
'android:name': 'android.intent.category.DEFAULT'
270270
}
271271
}, {
272272
'$': {
273273
'android:name': 'android.intent.category.BROWSABLE'
274274
}
275-
}],
276-
'data': [{
275+
} ],
276+
'data': [ {
277277
'$': {
278278
'android:host': host,
279279
'android:scheme': scheme,
280280
'android:pathPrefix': pathPrefix
281281
}
282-
}]
282+
} ]
283283
};
284284

285285
if (!pathPrefix) {
@@ -295,4 +295,4 @@ Class injects plugin preferences into AndroidManifest.xml file.
295295

296296
// endregion
297297

298-
})();
298+
})();

hooks/lib/configXmlHelper.js renamed to hooks.es6/lib/configXmlHelper.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ Helper class to read data from config.xml file.
4747
packageName;
4848

4949
switch (platform) {
50-
case ANDROID:
51-
{
50+
case ANDROID: {
5251
packageName = config.android_packageName();
5352
break;
5453
}
55-
case IOS:
56-
{
54+
case IOS: {
5755
packageName = config.ios_CFBundleIdentifier();
5856
break;
5957
}

hooks/lib/configXmlParser.js renamed to hooks.es6/lib/configXmlParser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Parser for config.xml file. Read plugin-specific preferences (from <branch-confi
5050
return {
5151
'hosts': hosts,
5252
'iosTeamId': iosTeamId,
53-
'androidPrefix' : androidPrefix
53+
'androidPrefix': androidPrefix
5454
};
5555
}
5656

@@ -129,4 +129,4 @@ Parser for config.xml file. Read plugin-specific preferences (from <branch-confi
129129

130130
// endregion
131131

132-
})();
132+
})();

hooks/lib/ios/xcodePreferences.js renamed to hooks.es6/lib/ios/xcodePreferences.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ Which is:
7070
buildSettings['IPHONEOS_DEPLOYMENT_TARGET'] = IOS_DEPLOYMENT_TARGET;
7171
deploymentTargetIsUpdated = true;
7272
}
73-
} else {
73+
}
74+
else {
7475
buildSettings['IPHONEOS_DEPLOYMENT_TARGET'] = IOS_DEPLOYMENT_TARGET;
7576
deploymentTargetIsUpdated = true;
7677
}

0 commit comments

Comments
 (0)