type == platform || plugin name == 'ios', 'android', 'cordova-plugin-camera'
486932
function(json, name, type) {
  if (json && json.widget) {
    var nodes = json.widget[type];

    if (!!nodes && isArray(nodes)) {
      for (var i = 0; i < nodes.length; i++) {
        if (nameIsMatch(nodes[i], name)) {
          return true;
        }
      }
    }
  }

  return false;
}
714771
function(project, options) {
    var validations = [];
    var projectConfig = project.config(options.environment);

    var validateRootUrl = new ValidateRootUrl({
      config: projectConfig,
      force: options.force
    });

    var validateLocationType = new ValidateLocationType({
      config: projectConfig
    });

    var validateAllowNavigation = new ValidateAllowNavigation({
      project: project,
      rejectIfUndefined: true
    });

    var validatePlugin = new ValidatePluginTask({
      project: project,
      platform: options.platform,
      pluginName: 'cordova-plugin-whitelist'
    });

    var validatePlatform = new ValidatePlatformTask({
      project: project,
      platform: options.platform
    });

    validations.push(
      validateRootUrl.run(),
      validateLocationType.run(),
      validateAllowNavigation.run(),
      validatePlatform.run(),
      validatePlugin.run()
    );

    return runValidators(validations);
  }
1112296
function startCameraDefaultResolution () {
  let facingMode = facingModeSelectElement.value;
  cameraPhoto.startCamera(FACING_MODES[facingMode])
    .then(() => {
      let log =
          `Camera started with default resolution and ` +
          `prefered facingMode : ${facingMode}`;
      console.log(log);
    })
    .catch((error) => {
      console.error('Camera not started!', error);
    });
}
699525
function plugin_parser(xmlPath) {
    this.path = xmlPath;
    this.doc = xml.parseElementtreeSync(xmlPath);
    this.platforms = this.doc.findall('platform').map(function(p) {
        return p.attrib.name;
    });
}
1079224
def _convert_camera(camera):
    
    result = {
        "name": camera.name,
        "type": "perspective",
        "perspective": {
            "aspectRatio": camera.fov[0] / camera.fov[1],
            "yfov": np.radians(camera.fov[1]),
        },
    }
    return result
1029140
function () {
        "use strict";
    
        Object.defineProperty(this, 'isPhonegap', {
            'get': function () {
    
                return (!!window.cordova || !!window.PhoneGap || !!window.phonegap)
                    && /^file:\/{3}[^\/]/i.test(window.location.href)
                    && /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent);
    
            }
        });
    
        var ready;
        Object.defineProperty(this, 'ready', {
            'get': function () {
                return ready;
            }
        });
    
        var callbacks = [];
    
        function onDeviceReady() {
    
            ready = true;
            for (var i in callbacks) {
                try {
                    callbacks[i]();
                }
                catch (exc) {
                    console.log(exc);
                }
            }
    
            callbacks = [];
    
        }
    
        document.addEventListener('deviceready', onDeviceReady);
    
        this.done = function (callback) {
    
            if (typeof callback !== 'function') {
                console.error('Invalid callback function.');
                return;
            }
    
            if (ready) {
                callback();
            }
            else {
                callbacks.push(callback);
            }
    
        };
    
    }
404154
function (done, options) {
      if (!isEnumerateDevicesSupported()) {
        return done(options.NOT_AVAILABLE)
      }
      navigator.mediaDevices.enumerateDevices().then(function (devices) {
        done(devices.map(function (device) {
          return 'id=' + device.deviceId + ';gid=' + device.groupId + ';' + device.kind + ';' + device.label
        }))
      })
        .catch(function (error) {
          done(error)
        })
    }
1074095
def check_platform(platform)
      options = %w[ios android all]
      if platform.nil?
        puts 'No platform detected... Options: ios,android,all'
        exit
      elsif !options.include? platform.downcase
        puts "Invalid platform #{platform}"
        exit
      end
    end
181406
function run(context) {
    const preferences = configPreferences.read(context);
    const platforms = context.opts.cordova.platforms;

    platforms.forEach(platform => {
      if (platform === IOS) {
        iosPlist.addBranchSettings(preferences);
        iosCapabilities.enableAssociatedDomains(preferences);
        iosAssociatedDomains.addAssociatedDomains(preferences);
      }
    });
  }
664032
function(assetsPath, projectPath) {
    if (assetsPath === undefined) {
      throw new Error('ember-cordova: Platform asset path undefined, cant build');
    }

    var platformPath = path.join(projectPath, assetsPath, 'cordova.js');
    var pluginPath = path.join(projectPath, assetsPath, 'cordova_plugins.js');

    if (!existsSync(platformPath) || !existsSync(pluginPath)) {
      logger.warn(
        'Did not find cordova.js or cordova_plugins.js at ' +
        assetsPath +
        '. Ember App LiveReload will still work, but device & plugin APIS will fail.'
      );
    }
  }
545580
function(canvas, useDevicePixelRatio) {
    var mult = useDevicePixelRatio ? window.devicePixelRatio : 1;
    mult = mult || 1;
    var width  = Math.floor(canvas.clientWidth  * mult);
    var height = Math.floor(canvas.clientHeight * mult);
    if (canvas.width !== width ||
        canvas.height !== height) {
      canvas.width = width;
      canvas.height = height;
      return true;
    }
  }
257524
function preparePlatforms (platformList, projectRoot, options) {
    return Q.all(platformList.map(function(platform) {
        // TODO: this need to be replaced by real projectInfo
        // instance for current project.
        var project = {
            root: projectRoot,
            projectConfig: new ConfigParser(cordova_util.projectConfig(projectRoot)),
            locations: {
                plugins: path.join(projectRoot, 'plugins'),
                www: cordova_util.projectWww(projectRoot)
            }
        };

        // CB-9987 We need to reinstall the plugins for the platform it they were added by cordova@<5.4.0
        return restoreMissingPluginsForPlatform(platform, projectRoot, options)
        .then(function () {
            // platformApi prepare takes care of all functionality
            // which previously had been executed by cordova.prepare:
            //   - reset config.xml and then merge changes from project's one,
            //   - update www directory from project's one and merge assets from platform_www,
            //   - reapply config changes, made by plugins,
            //   - update platform's project
            // Please note that plugins' changes, such as installed js files, assets and
            // config changes is not being reinstalled on each prepare.
            var platformApi = platforms.getPlatformApi(platform);
            return platformApi.prepare(project, _.clone(options))
            .then(function () {
                if (platform === 'windows' && !(platformApi instanceof PlatformApiPoly)) {
                    // Windows Api doesn't fire 'pre_package' hook, so we fire it here
                    return new HooksRunner(projectRoot).fire('pre_package', {
                        wwwPath: platformApi.getPlatformInfo().locations.www,
                        platforms: ['windows'],
                        nohooks: options.nohooks
                    });
                }
            })
            .then(function () {
                if (options.browserify) {
                    var browserify = require('../plugman/browserify');
                    return browserify(project, platformApi);
                }
            })
            .then(function () {
                // Handle edit-config in config.xml
                var platformRoot = path.join(projectRoot, 'platforms', platform);
                var platformJson = PlatformJson.load(platformRoot, platform);
                var munger = new PlatformMunger(platform, platformRoot, platformJson);
                munger.add_config_changes(project.projectConfig, /*should_increment=*/true).save_all();
            });
        });
    }));
}
680483
function() {
		var appVersion = navigator.appVersion;
		mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1; 
		mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
		mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
		mfp.isAndroid = (/android/gi).test(appVersion);
		mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
		mfp.supportsTransition = supportsTransitions();

		// We disable fixed positioned lightbox on devices that don't handle it nicely.
		// If you know a better way of detecting this - let me know.
		mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
		_document = $(document);

		mfp.popupsCache = {};
	}
307491
function DeviceInfo (deviceIndex, deviceName, deviceType) {
    this.index = deviceIndex;
    this.name = deviceName;
    this.type = deviceType;
}
847793
function UniversalCamera(name, position, scene) {
            var _this = _super.call(this, name, position, scene) || this;
            _this.inputs.addGamepad();
            return _this;
        }
535475
function getProjectModule(context) {
    const projectRoot = getProjectRoot(context);
    const projectPath = path.join(projectRoot, "platforms", "ios");

    try {
      // pre 5.0 cordova structure
      return context
        .requireCordovaModule("cordova-lib/src/plugman/platforms")
        .ios.parseProjectFile(projectPath);
    } catch (e) {
      try {
        // pre 7.0 cordova structure
        return context
          .requireCordovaModule("cordova-lib/src/plugman/platforms/ios")
          .parseProjectFile(projectPath);
      } catch (e) {
        // post 7.0 cordova structure
        return getProjectModuleGlob(context);
      }
    }
  }
790648
public function mapDeviceType(?string $deviceType): TypeInterface
    {
        if (null === $deviceType) {
            return (new TypeLoader())->load('unknown');
        }

        switch (mb_strtolower($deviceType)) {
            case 'smart-tv':
            case 'tv device':
                $typeKey = 'tv';
                break;
            case 'desktop':
                $typeKey = 'desktop';
                break;
            case 'fonepad':
                $typeKey = 'fone-pad';
                break;
            case 'tablet':
                $typeKey = 'tablet';
                break;
            case 'mobile device':
                $typeKey = 'mobile-device';
                break;
            case 'mobile phone':
                $typeKey = 'mobile-phone';
                break;
            case 'smartphone':
                $typeKey = 'smartphone';
                break;
            case 'feature phone':
                $typeKey = 'feature-phone';
                break;
            case 'digital camera':
                $typeKey = 'digital-camera';
                break;
            default:
                $typeKey = 'unknown';
                break;
        }

        return (new TypeLoader())->load($typeKey);
    }