Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function AppCreator(logger, config, cli) { // eslint-disable-line no-unused-vars
Creator.apply(this, arguments);
this.title = __('Titanium App');
this.titleOrder = 1;
this.type = 'app';
// build list of all valid platforms
const availablePlatforms = {},
validPlatforms = {};
ti.platforms.forEach(function (platform) {
if (/^iphone|ios|ipad$/.test(platform)) {
validPlatforms['iphone'] = availablePlatforms['iphone'] = 1;
validPlatforms['ipad'] = availablePlatforms['ipad'] = 1;
validPlatforms['ios'] = 1;
} else {
validPlatforms[platform] = availablePlatforms[platform] = 1;
}
});
// add "all"
validPlatforms['all'] = 1;
this.availablePlatforms = [ 'all' ].concat(Object.keys(availablePlatforms));
this.validPlatforms = validPlatforms;
}
function ModuleCreator(logger, config, cli) { // eslint-disable-line no-unused-vars
Creator.apply(this, arguments);
this.title = __('Titanium Module');
this.titleOrder = 2;
this.type = 'module';
// build list of all valid platforms
const availablePlatforms = {},
validPlatforms = {};
ti.platforms.forEach(function (platform) {
if (/^iphone|ios|ipad$/.test(platform)) {
validPlatforms['iphone'] = 1;
validPlatforms['ipad'] = 1;
validPlatforms['ios'] = availablePlatforms['ios'] = 1;
} else {
validPlatforms[platform] = availablePlatforms[platform] = 1;
}
});
// add "all"
validPlatforms['all'] = 1;
this.availablePlatforms = [ 'all' ].concat(Object.keys(availablePlatforms));
this.validPlatforms = validPlatforms;
}