{"size": 342, "ext": "js", "max_stars_repo_path": "Distributions/OpenVanilla-Leopard-0.8/PackageMaker.app/Contents/Resources/deviceOfTypeExists.js", "max_stars_repo_name": "chewing/openvanilla-chewing", "max_stars_repo_stars_event_min_datetime": "2016-12-30T03:09:15.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-24T09:24:51.000Z", "max_issues_repo_path": "Distributions/OpenVanilla-Leopard-0.8/PackageMaker.app/Contents/Resources/deviceOfTypeExists.js", "max_issues_repo_name": "chewing/openvanilla-chewing", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Distributions/OpenVanilla-Leopard-0.8/PackageMaker.app/Contents/Resources/deviceOfTypeExists.js", "max_forks_repo_name": "chewing/openvanilla-chewing", "max_forks_repo_forks_event_min_datetime": "2022-01-08T14:58:41.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-08T14:58:41.000Z"}
{"max_stars_count": 8, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.8, "max_line_length": 83, "alphanum_fraction": 0.6695906433}
function deviceOfTypeExists(deviceClass, deviceName)
{
	var classObjects = system.ioregistry.matchingClass('IO' + deviceClass + 'Device');
	
	if(classObjects) {
		for( var i = 0; i < classObjects.length; i++){
			var obj = classObjects[i];
			
			if(obj[deviceClass + ' Product Name'] == deviceName)
				return true;
		}
	}
	
	return false;
}