Stephen McKamey avatar Stephen McKamey committed 276794d

making ua keys more JS friendly

Comments (0)

Files changed (5)

 	User-agent specific CSS support
 
 	Created: 2006-06-10-1635
-	Modified: 2011-12-17-1450
+	Modified: 2011-12-17-1534
 
 	Copyright (c)2006-2011 Stephen M. McKamey
 	Distributed under The MIT License.
 		R_Version = /([\w\-\.]+[\s\/][v]?[\d_]+\b([\-\._\/]\w+)*)/g,
 
 		R_Gecko = /rv[:](\d+(\.\w+)*).*?\bgecko[\/]\w+/,
-		R_iOS = /\bos[\s]+(\d+(_\w+)*) like mac os x/,
 		R_BlackBerry = /\bblackberry\w*[\s\/]+(\d+(\.\w+)*)/,
 		R_desktop = /(\bwindows\b|\bmacintosh\b|\blinux\b|\bunix\b)/,
 		R_mobile = /(\bandroid\b|\bipad\b|\bipod\b|\bblackberry|\brim tablet os\b|\bwebos\b|\bwindows ce\b|\bwindows phone os\b|\bwindows ce\b|\bpalm|\bsymbian|\bj2me\b|\bdocomo\b|\bpda\b|\bchtml\b|\bmidp\b|\bcldc\b|\w*?mobile\w*?|\w*?phone\w*?)/,
 					// inside parens covers platform identifiers
 					var platforms = raw[j].split(';');
 					for (i=0, count=platforms.length; i<count; i++) {
-						if (R_Platform.exec(platforms[i]) &&
-							// filter iOS variants here
-							RegExp.$1 !== 'cpu iphone os' && RegExp.$1 !== 'cpu os' &&
+						if (R_Platform.exec(platforms[i])) {
+							var key = RegExp.$1.split(' ').join('_'),
+								val = RegExp.$2;
+
 							// if duplicate entries favor highest version
-							(!ua[RegExp.$1] || parseFloat(ua[RegExp.$1]) < parseFloat(RegExp.$2))) {
-
-							ua[RegExp.$1] = RegExp.$2;
+							if ((!ua[key] || parseFloat(ua[key]) < parseFloat(val))) {
+								ua[key] = val;
+							}
 						}
 					}
 
 						for (i=0, count=uas.length; i<count; i++) {
 							var parts = uas[i].split(/[\/\s]+/);
 							if (parts.length && parts[0] !== 'mozilla') {
-								ua[parts[0]] = parts.slice(1).join('-');
+								ua[parts[0].split(' ').join('_')] = parts.slice(1).join('-');
 							}
 						}
 					}
 			} else if (R_game.exec(uaStr)) {
 				// game console indicators
 				ua.game = RegExp.$1;
+				var game = ua.game.split(' ').join('_');
 
-				if (ua.version && !ua[ua.game]) {
-					ua[ua.game] = ua.version;
+				if (ua.version && !ua[game]) {
+					ua[game] = ua.version;
 				}
 			}
 
 			// platform naming standardizations
-			if (ua['intel mac os x']) {
-				ua['mac os x'] = ua['intel mac os x'].split('_').join('.');
-				delete ua['intel mac os x'];
+			if (ua.intel_mac_os_x) {
+				ua.mac_os_x = ua.intel_mac_os_x.split('_').join('.');
+				delete ua.intel_mac_os_x;
 
-			} else if (R_iOS.exec(uaStr)) {
-				ua.ios = RegExp.$1.split('_').join('.');
+			} else if (ua.cpu_iphone_os) {
+				ua.ios = ua.cpu_iphone_os.split('_').join('.');
+				delete ua.cpu_iphone_os;
+
+			} else if (ua.cpu_os) {
+				ua.ios = ua.cpu_os.split('_').join('.');
+				delete ua.cpu_os;
 			}
 
 			// UA naming standardizations
 				if (ua.safari) {
 					if (ua.chrome || (ua.mobile && !ua.ios)) {
 						delete ua.safari;
-	
-					} else if (ua.version && !ua['rim tablet os']) {
+
+					} else if (ua.version && !ua.rim_tablet_os) {
 						ua.safari = ua.version;
 	
 					} else {
 
 		/*string*/ format : function (/*Map<string,string>*/ ua) {
 			/*string*/ function format(/*string*/ b, /*string*/ v) {
-				b = b.split(' ').join('_').split('.').join('-');
+				b = b.split('.').join('-');
 				/*string*/ var css = PREFIX+b;
 				if (v) {
 					v = v.split(' ').join('_').split('.').join('-');
-var cssua=function(j,l){var m=/\s*([\-\w ]+)[\s\/]([\d_]+\b([\-\._\/]\w+)*)/,n=/([\w\-\.]+[\s\/][v]?[\d_]+\b([\-\._\/]\w+)*)/g,o=/rv[:](\d+(\.\w+)*).*?\bgecko[\/]\w+/,p=/\bos[\s]+(\d+(_\w+)*) like mac os x/,q=/\bblackberry\w*[\s\/]+(\d+(\.\w+)*)/,r=/(\bwindows\b|\bmacintosh\b|\blinux\b|\bunix\b)/,s=/(\bandroid\b|\bipad\b|\bipod\b|\bblackberry|\brim tablet os\b|\bwebos\b|\bwindows ce\b|\bwindows phone os\b|\bwindows ce\b|\bpalm|\bsymbian|\bj2me\b|\bdocomo\b|\bpda\b|\bchtml\b|\bmidp\b|\bcldc\b|\w*?mobile\w*?|\w*?phone\w*?)/,
-t=/(\bxbox\b|\bplaystation\b|\bnintendo\s+\w+)/,d={parse:function(c){var a={},c=(""+c).toLowerCase();if(!c)return a;for(var b,g,e=c.split(/[()]/),f=0,d=e.length;f<d;f++)if(f%2){var h=e[f].split(";");for(b=0,g=h.length;b<g;b++)if(m.exec(h[b])&&"cpu iphone os"!==RegExp.$1&&"cpu os"!==RegExp.$1&&(!a[RegExp.$1]||parseFloat(a[RegExp.$1])<parseFloat(RegExp.$2)))a[RegExp.$1]=RegExp.$2}else if(h=e[f].match(n))for(b=0,g=h.length;b<g;b++){var i=h[b].split(/[\/\s]+/);i.length&&"mozilla"!==i[0]&&(a[i[0]]=i.slice(1).join("-"))}if(s.exec(c)){if(a.mobile=
-RegExp.$1,q.exec(c))a.blackberry=RegExp.$1}else if(r.exec(c))a.desktop=RegExp.$1;else if(t.exec(c)&&(a.game=RegExp.$1,a.version&&!a[a.game]))a[a.game]=a.version;if(a["intel mac os x"])a["mac os x"]=a["intel mac os x"].split("_").join("."),delete a["intel mac os x"];else if(p.exec(c))a.ios=RegExp.$1.split("_").join(".");if(a.opera&&a.version)a.opera=a.version;if(a.applewebkit){if(a.webkit=a.applewebkit,delete a.applewebkit,a.safari)a.chrome||a.mobile&&!a.ios?delete a.safari:a.safari=a.version&&!a["rim tablet os"]?
-a.version:{419:"2.0.4",417:"2.0.3",416:"2.0.2",412:"2.0",312:"1.3",125:"1.2",85:"1.0"}[parseInt(a.safari,10)]||a.safari}else if(a.msie){if(!a.opera)a.ie=a.msie;delete a.msie}else if(o.exec(c))a.gecko=RegExp.$1;a.version&&delete a.version;return a},format:function(c){var a="",b;for(b in c)if(b&&c.hasOwnProperty(b)){var g=b,e=c[b],g=g.split(" ").join("_").split(".").join("-"),f=" ua-"+g;if(e){for(var e=e.split(" ").join("_").split(".").join("-"),d=e.indexOf("-");0<d;)f+=" ua-"+g+"-"+e.substring(0,d),
-d=e.indexOf("-",d+1);f+=" ua-"+g+"-"+e}a+=f}return a},encode:function(c){var a="",b;for(b in c)b&&c.hasOwnProperty(b)&&(a&&(a+="&"),a+=encodeURIComponent(b)+"="+encodeURIComponent(c[b]));return a}};d.userAgent=d.ua=d.parse(l);var k=d.format(d.ua)+" js";j.className=j.className?j.className.replace(/\bno-js\b/g,"")+k:k.substr(1);return d}(document.documentElement,navigator.userAgent);
+var cssua=function(i,l){var m=/\s*([\-\w ]+)[\s\/]([\d_]+\b([\-\._\/]\w+)*)/,n=/([\w\-\.]+[\s\/][v]?[\d_]+\b([\-\._\/]\w+)*)/g,o=/rv[:](\d+(\.\w+)*).*?\bgecko[\/]\w+/,p=/\bblackberry\w*[\s\/]+(\d+(\.\w+)*)/,q=/(\bwindows\b|\bmacintosh\b|\blinux\b|\bunix\b)/,r=/(\bandroid\b|\bipad\b|\bipod\b|\bblackberry|\brim tablet os\b|\bwebos\b|\bwindows ce\b|\bwindows phone os\b|\bwindows ce\b|\bpalm|\bsymbian|\bj2me\b|\bdocomo\b|\bpda\b|\bchtml\b|\bmidp\b|\bcldc\b|\w*?mobile\w*?|\w*?phone\w*?)/,s=/(\bxbox\b|\bplaystation\b|\bnintendo\s+\w+)/,
+d={parse:function(c){var a={},c=(""+c).toLowerCase();if(!c)return a;for(var b,g,e=c.split(/[()]/),f=0,d=e.length;f<d;f++)if(f%2){var j=e[f].split(";");for(b=0,g=j.length;b<g;b++)if(m.exec(j[b])){var h=RegExp.$1.split(" ").join("_"),i=RegExp.$2;if(!a[h]||parseFloat(a[h])<parseFloat(i))a[h]=i}}else if(j=e[f].match(n))for(b=0,g=j.length;b<g;b++)h=j[b].split(/[\/\s]+/),h.length&&"mozilla"!==h[0]&&(a[h[0].split(" ").join("_")]=h.slice(1).join("-"));if(r.exec(c)){if(a.mobile=RegExp.$1,p.exec(c))a.blackberry=
+RegExp.$1}else if(q.exec(c))a.desktop=RegExp.$1;else if(s.exec(c)&&(a.game=RegExp.$1,b=a.game.split(" ").join("_"),a.version&&!a[b]))a[b]=a.version;if(a.intel_mac_os_x)a.mac_os_x=a.intel_mac_os_x.split("_").join("."),delete a.intel_mac_os_x;else if(a.cpu_iphone_os)a.ios=a.cpu_iphone_os.split("_").join("."),delete a.cpu_iphone_os;else if(a.cpu_os)a.ios=a.cpu_os.split("_").join("."),delete a.cpu_os;if(a.opera&&a.version)a.opera=a.version;if(a.applewebkit){if(a.webkit=a.applewebkit,delete a.applewebkit,
+a.safari)a.chrome||a.mobile&&!a.ios?delete a.safari:a.safari=a.version&&!a.rim_tablet_os?a.version:{419:"2.0.4",417:"2.0.3",416:"2.0.2",412:"2.0",312:"1.3",125:"1.2",85:"1.0"}[parseInt(a.safari,10)]||a.safari}else if(a.msie){if(!a.opera)a.ie=a.msie;delete a.msie}else if(o.exec(c))a.gecko=RegExp.$1;a.version&&delete a.version;return a},format:function(c){var a="",b;for(b in c)if(b&&c.hasOwnProperty(b)){var g=b,e=c[b],g=g.split(".").join("-"),f=" ua-"+g;if(e){for(var e=e.split(" ").join("_").split(".").join("-"),
+d=e.indexOf("-");0<d;)f+=" ua-"+g+"-"+e.substring(0,d),d=e.indexOf("-",d+1);f+=" ua-"+g+"-"+e}a+=f}return a},encode:function(c){var a="",b;for(b in c)b&&c.hasOwnProperty(b)&&(a&&(a+="&"),a+=encodeURIComponent(b)+"="+encodeURIComponent(c[b]));return a}};d.userAgent=d.ua=d.parse(l);var k=d.format(d.ua)+" js";i.className=i.className?i.className.replace(/\bno-js\b/g,"")+k:k.substr(1);return d}(document.documentElement,navigator.userAgent);

test/encodeTests.js

 
 	var input =
 		{
-			'ie': '5.5'
+			ie: '5.5'
 		};
 
 	var expected = 'ie=5.5';
 
 	var input =
 		{
-			'gecko': '1.9.2.13',
-			'firefox': '3.6.13'
+			gecko: '1.9.2.13',
+			firefox: '3.6.13'
 		};
 
 	var expected = 'gecko=1.9.2.13&firefox=3.6.13';
 
 	var input =
 		{
-			'webkit': '525.13',
-			'chrome': '0.2.149.30'
+			webkit: '525.13',
+			chrome: '0.2.149.30'
 		};
 
 	var expected = 'webkit=525.13&chrome=0.2.149.30';
 
 	var input =
 		{
-			'webkit': '534.15',
-			'chrome': '10.0.612.3'
+			webkit: '534.15',
+			chrome: '10.0.612.3'
 		};
 
 	var expected = 'webkit=534.15&chrome=10.0.612.3';
 
 	var input =
 		{
-			'webkit': '531.21.10',
-			'mobile': 'ipad',
-			'safari': '4.0.4'
+			webkit: '531.21.10',
+			mobile: 'ipad',
+			safari: '4.0.4'
 		};
 
 	var expected = 'webkit=531.21.10&mobile=ipad&safari=4.0.4';

test/formatTests.js

 
 	var input =
 		{
-			'windows nt': '5.0',
-			'os': 'windows',
-			'ie': '5.5'
+			windows_nt: '5.0',
+			os: 'windows',
+			ie: '5.5'
 		};
 
 	var expected = ' ua-windows_nt ua-windows_nt-5 ua-windows_nt-5-0 ua-os ua-os-windows ua-ie ua-ie-5 ua-ie-5-5';
 
 	var input =
 		{
-			'gecko': '1.9.2.13',
-			'firefox': '3.6.13'
+			gecko: '1.9.2.13',
+			firefox: '3.6.13'
 		};
 
 	var expected = ' ua-gecko ua-gecko-1 ua-gecko-1-9 ua-gecko-1-9-2 ua-gecko-1-9-2-13 ua-firefox ua-firefox-3 ua-firefox-3-6 ua-firefox-3-6-13';
 
 	var input =
 		{
-			'webkit': '525.13',
-			'chrome': '0.2.149.30'
+			webkit: '525.13',
+			chrome: '0.2.149.30'
 		};
 
 	var expected = ' ua-webkit ua-webkit-525 ua-webkit-525-13 ua-chrome ua-chrome-0 ua-chrome-0-2 ua-chrome-0-2-149 ua-chrome-0-2-149-30';
 
 	var input =
 		{
-			'webkit': '534.15',
-			'chrome': '10.0.612.3'
+			webkit: '534.15',
+			chrome: '10.0.612.3'
 		};
 
 	var expected = ' ua-webkit ua-webkit-534 ua-webkit-534-15 ua-chrome ua-chrome-10 ua-chrome-10-0 ua-chrome-10-0-612 ua-chrome-10-0-612-3';
 
 	var input =
 		{
-			'mobile': 'ipad',
-			'safari': '4.0.4',
-			'ios': '3.2',
-			'webkit': '531.21.10'
+			mobile: 'ipad',
+			safari: '4.0.4',
+			ios: '3.2',
+			webkit: '531.21.10'
 		};
 
 	var expected = ' ua-mobile ua-mobile-ipad ua-safari ua-safari-4 ua-safari-4-0 ua-safari-4-0-4 ua-ios ua-ios-3 ua-ios-3-2 ua-webkit ua-webkit-531 ua-webkit-531-21 ua-webkit-531-21-10';
 
 	var input =
 		{
-			'trident': '3.1',
-			'iemobile': '7.0',
-			'ie': '7.0',
-			'mobile': 'windows phone os'
+			trident: '3.1',
+			iemobile: '7.0',
+			ie: '7.0',
+			mobile: 'windows phone os'
 		};
 
 	var expected = ' ua-trident ua-trident-3 ua-trident-3-1 ua-iemobile ua-iemobile-7 ua-iemobile-7-0 ua-ie ua-ie-7 ua-ie-7-0 ua-mobile ua-mobile-windows_phone_os';

test/parseTests.js

 
 	var expected =
 		{
-			'windows': '98',
-			'desktop': 'windows',
-			'ie': '5.0'
+			windows: '98',
+			desktop: 'windows',
+			ie: '5.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.0',
-			'net clr': '3.5.21022',
-			'ms-rtc lm': '8',
-			'desktop': 'windows',
-			'ie': '5.5'
+			windows_nt: '5.0',
+			net_clr: '3.5.21022',
+			'ms-rtc_lm': '8',
+			desktop: 'windows',
+			ie: '5.5'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.0',
-			'net clr': '3.5.30729',
-			'desktop': 'windows',
-			'ie': '6.0'
+			windows_nt: '6.0',
+			net_clr: '3.5.30729',
+			desktop: 'windows',
+			ie: '6.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.2',
-			'net clr': '3.5.30729',
-			'desktop': 'windows',
-			'ie': '7.0'
+			windows_nt: '5.2',
+			net_clr: '3.5.30729',
+			desktop: 'windows',
+			ie: '7.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'trident': '4.0',
-			'net clr': '3.5.30729',
-			'desktop': 'windows',
-			'ie': '8.0'
+			windows_nt: '6.1',
+			trident: '4.0',
+			net_clr: '3.5.30729',
+			desktop: 'windows',
+			ie: '8.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'trident': '5.0',
-			'net clr': '3.5.30729',
-			'desktop': 'windows',
-			'ie': '9.0'
+			windows_nt: '6.1',
+			trident: '5.0',
+			net_clr: '3.5.30729',
+			desktop: 'windows',
+			ie: '9.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'mspie': '2.0',
-			'mobile': 'windows ce'
+			mspie: '2.0',
+			mobile: 'windows ce'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.2',
-			'gecko': '1.8.0.9',
-			'firefox': '1.5.0.9',
-			'desktop': 'windows'
+			windows_nt: '5.2',
+			gecko: '1.8.0.9',
+			firefox: '1.5.0.9',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'gecko': '1.8.1.19',
-			'ubuntu': '7.10',
-			'firefox': '2.0.0.19',
-			'desktop': 'linux'
+			gecko: '1.8.1.19',
+			ubuntu: '7.10',
+			firefox: '2.0.0.19',
+			desktop: 'linux'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.2',
-			'gecko': '1.9.0.19',
-			'firefox': '3.0.19',
-			'net clr': '3.5.30729',
-			'desktop': 'windows'
+			windows_nt: '5.2',
+			gecko: '1.9.0.19',
+			firefox: '3.0.19',
+			net_clr: '3.5.30729',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'gecko': '1.9.1.15',
-			'fedora': '3.5.15-1.fc12',
-			'firefox': '3.5.15',
-			'desktop': 'linux'
+			gecko: '1.9.1.15',
+			fedora: '3.5.15-1.fc12',
+			firefox: '3.5.15',
+			desktop: 'linux'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'gecko': '1.9.2.13',
-			'firefox': '3.6.13',
-			'net clr': '3.5.30729',
-			'desktop': 'windows'
+			windows_nt: '6.1',
+			gecko: '1.9.2.13',
+			firefox: '3.6.13',
+			net_clr: '3.5.30729',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'gecko': '2.0b7',
-			'firefox': '4.0b7',
-			'desktop': 'windows'
+			windows_nt: '6.1',
+			gecko: '2.0b7',
+			firefox: '4.0b7',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.0',
-			'chrome': '0.2.149.30',
-			'desktop': 'windows',
-			'webkit': '525.13'
+			windows_nt: '6.0',
+			chrome: '0.2.149.30',
+			desktop: 'windows',
+			webkit: '525.13'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.2',
-			'chrome': '1.0.154.53',
-			'desktop': 'windows',
-			'webkit': '525.19'
+			windows_nt: '5.2',
+			chrome: '1.0.154.53',
+			desktop: 'windows',
+			webkit: '525.19'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.1',
-			'chrome': '2.0.174.0',
-			'desktop': 'windows',
-			'webkit': '530.6'
+			windows_nt: '5.1',
+			chrome: '2.0.174.0',
+			desktop: 'windows',
+			webkit: '530.6'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'chrome': '3.0.198.0',
-			'desktop': 'linux',
-			'webkit': '532.0'
+			chrome: '3.0.198.0',
+			desktop: 'linux',
+			webkit: '532.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'chrome': '4.0.207.0',
-			'desktop': 'macintosh',
-			'mac os x': '10.6.1',
-			'webkit': '532.0'
+			chrome: '4.0.207.0',
+			desktop: 'macintosh',
+			mac_os_x: '10.6.1',
+			webkit: '532.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'chrome': '5.0.375.99',
-			'desktop': 'macintosh',
-			'mac os x': '10.5.6',
-			'webkit': '533.4'
+			chrome: '5.0.375.99',
+			desktop: 'macintosh',
+			mac_os_x: '10.5.6',
+			webkit: '533.4'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.1',
-			'chrome': '6.0.458.1',
-			'desktop': 'windows',
-			'webkit': '534.3'
+			windows_nt: '5.1',
+			chrome: '6.0.458.1',
+			desktop: 'windows',
+			webkit: '534.3'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'chrome': '7.0.544.0',
-			'desktop': 'linux',
-			'webkit': '534.10'
+			chrome: '7.0.544.0',
+			desktop: 'linux',
+			webkit: '534.10'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'chrome': '8.0.552.224',
-			'desktop': 'windows',
-			'webkit': '534.10'
+			windows_nt: '6.1',
+			chrome: '8.0.552.224',
+			desktop: 'windows',
+			webkit: '534.10'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '5.2',
-			'chrome': '9.0.597.19',
-			'desktop': 'windows',
-			'webkit': '534.13'
+			windows_nt: '5.2',
+			chrome: '9.0.597.19',
+			desktop: 'windows',
+			webkit: '534.13'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'chrome': '10.0.612.3',
-			'desktop': 'windows',
-			'webkit': '534.15'
+			windows_nt: '6.1',
+			chrome: '10.0.612.3',
+			desktop: 'windows',
+			webkit: '534.15'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'safari': '1.0',
-			'desktop': 'macintosh',
-			'webkit': '85'
+			safari: '1.0',
+			desktop: 'macintosh',
+			webkit: '85'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'safari': '2.0.4',
-			'desktop': 'macintosh',
-			'webkit': '418.8'
+			safari: '2.0.4',
+			desktop: 'macintosh',
+			webkit: '418.8'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'safari': '3.1.1',
-			'mobile': 'ipod',
-			'ios': '2.2.1',
-			'webkit': '525.18.1'
+			safari: '3.1.1',
+			mobile: 'ipod',
+			ios: '2.2.1',
+			webkit: '525.18.1'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'safari': '4.0.4',
-			'mobile': 'ipad',
-			'ios': '3.2',
-			'webkit': '531.21.10'
+			safari: '4.0.4',
+			mobile: 'ipad',
+			ios: '3.2',
+			webkit: '531.21.10'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'safari': '5.0.1',
-			'desktop': 'macintosh',
-			'mac os x': '10.6.4',
-			'webkit': '533.17.8'
+			safari: '5.0.1',
+			desktop: 'macintosh',
+			mac_os_x: '10.6.4',
+			webkit: '533.17.8'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'safari': '5.0.2',
-			'mobile': 'iphone',
-			'ios': '4.2.1',
-			'webkit': '533.17.9'
+			safari: '5.0.2',
+			mobile: 'iphone',
+			ios: '4.2.1',
+			webkit: '533.17.9'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.1',
-			'safari': '5.0.3',
-			'desktop': 'windows',
-			'webkit': '533.19.4'
+			windows_nt: '6.1',
+			safari: '5.0.3',
+			desktop: 'windows',
+			webkit: '533.19.4'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '4.0',
-			'opera': '5.11',
-			'desktop': 'windows'
+			windows_nt: '4.0',
+			opera: '5.11',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '6.12',
-			'desktop': 'unix'
+			opera: '6.12',
+			desktop: 'unix'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '7.54',
-			'windows nt': '5.1',
-			'desktop': 'windows'
+			opera: '7.54',
+			windows_nt: '5.1',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '8.5',
-			'desktop': 'macintosh'
+			opera: '8.5',
+			desktop: 'macintosh'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '9.62',
-			'windows nt': '5.1',
-			'presto': '2.1.1',
-			'desktop': 'windows'
+			opera: '9.62',
+			windows_nt: '5.1',
+			presto: '2.1.1',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '10.62',
-			'presto': '2.6.30',
-			'desktop': 'linux'
+			opera: '10.62',
+			presto: '2.6.30',
+			desktop: 'linux'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '11.00',
-			'windows nt': '6.1',
-			'presto': '2.7.62',
-			'desktop': 'windows'
+			opera: '11.00',
+			windows_nt: '6.1',
+			presto: '2.7.62',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows nt': '6.0',
-			'opera': '11.00',
-			'desktop': 'windows'
+			windows_nt: '6.0',
+			opera: '11.00',
+			desktop: 'windows'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '9.80',
-			'opera mini': '5.1.21214/19.916',
-			'presto': '2.5.25',
-			'mobile': 'j2me'
+			opera: '9.80',
+			opera_mini: '5.1.21214/19.916',
+			presto: '2.5.25',
+			mobile: 'j2me'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'android': '2.2.1',
-			'mobile': 'android',
-			'webkit': '533.1'
+			android: '2.2.1',
+			mobile: 'android',
+			webkit: '533.1'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'android': '2.1-update1',
-			'mobile': 'android',
-			'webkit': '530.17'
+			android: '2.1-update1',
+			mobile: 'android',
+			webkit: '530.17'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'android': '2.3.1',
-			'mobile': 'android',
-			'webkit': '533.1'
+			android: '2.3.1',
+			mobile: 'android',
+			webkit: '533.1'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'windows phone os': '7.0',
-			'trident': '3.1',
-			'iemobile': '7.0',
-			'mobile': 'windows phone os',
-			'ie': '7.0'
+			windows_phone_os: '7.0',
+			trident: '3.1',
+			iemobile: '7.0',
+			mobile: 'windows phone os',
+			ie: '7.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'blackberry9330': '5.0.0.913',
-			'vendorid': '104',
-			'mobile': 'blackberry',
-			'blackberry': '5.0.0.913'
+			blackberry9330: '5.0.0.913',
+			vendorid: '104',
+			mobile: 'blackberry',
+			blackberry: '5.0.0.913'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'blackberry': '9800',
-			'mobile': 'blackberry',
-			'webkit': '534.1'
+			blackberry: '9800',
+			mobile: 'blackberry',
+			webkit: '534.1'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'webos': '1.0',
-			'pre': '1.0',
-			'mobile': 'webos',
-			'webkit': '525.27.1'
+			webos: '1.0',
+			pre: '1.0',
+			mobile: 'webos',
+			webkit: '525.27.1'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			"iemobile": "7.11",
-			'mobile': 'windows ce',
-			'ie': '6.0'
+			iemobile: '7.11',
+			mobile: 'windows ce',
+			ie: '6.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'nokia3650': '1.0',
-			'symbianos': '6.1',
-			'series60': '1.2',
-			'mobile': 'symbian'
+			nokia3650: '1.0',
+			symbianos: '6.1',
+			series60: '1.2',
+			mobile: 'symbian'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'symbianos': '9.2',
-			'series60': '3.1',
-			'mobile': 'symbian',
-			'webkit': '413'
+			symbianos: '9.2',
+			series60: '3.1',
+			mobile: 'symbian',
+			webkit: '413'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'symbian os': '1.1.0',
-			'netfront': '3.1',
-			'mobile': 'smartphone',
-			'ie': '4.0'
+			symbian_os: '1.1.0',
+			netfront: '3.1',
+			mobile: 'smartphone',
+			ie: '4.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'aol': '9.6',
-			'aolbuild': '4340.122',
-			'windows nt': '6.1',
-			'trident': '4.0',
-			'net clr': '3.5.30729',
-			'media center pc': '6.0',
-			'ms-rtc lm': '8',
-			'desktop': 'windows',
-			'ie': '8.0'
+			aol: '9.6',
+			aolbuild: '4340.122',
+			windows_nt: '6.1',
+			trident: '4.0',
+			net_clr: '3.5.30729',
+			media_center_pc: '6.0',
+			'ms-rtc_lm': '8',
+			desktop: 'windows',
+			ie: '8.0'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'googlebot': '2.1'
+			googlebot: '2.1'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'game': 'nintendo 3ds',
-			'nintendo 3ds': '1.7455.eu'
+			game: 'nintendo 3ds',
+			nintendo_3ds: '1.7455.eu'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'opera': '9.30',
-			'game': 'nintendo wii'
+			opera: '9.30',
+			game: 'nintendo wii'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'playstation': '3',
-			'game': 'playstation'
+			playstation: '3',
+			game: 'playstation'
 		};
 
 	var actual = cssua.parse(input);
 
 	var expected =
 		{
-			'rim tablet os': '1.0.0',
-			'mobile': 'rim tablet os',
-			'webkit': '534.8'
+			rim_tablet_os: '1.0.0',
+			mobile: 'rim tablet os',
+			webkit: '534.8'
 		};
 
 	var actual = cssua.parse(input);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.