/**
 * Create mappings between the names parsed from useragent (based on
 * https://github.com/tobie/ua-parser/blob/master/regexes.yaml) to caniuse
 * name equivalents.
 *
 * Each caniuse name can match against many names.
 *
 * To add a new mapping add the UA name to the appropriate key.
 */

var agentmappings = {
	"firefox": [
		"pale moon (firefox variant)",
		"firefox mobile",
		"firefox namoroka",
		"firefox shiretoko",
		"firefox minefield",
		"firefox alpha",
		"firefox beta",
		"microb",
		"mozilladeveloperpreview"
	],
	"opera": [
		"opera tablet"
	],
	"op_mob": [
		"opera mobile"
	],
	"op_mini": [
		"opera mini"
	],
	"chrome": [
		"chrome mobile ios",
		"chrome mobile",
		"chrome frame",
		"chromium"
	],
	"ie_mob": [
		"ie mobile"
	],
	"ios_saf": [
		"mobile safari"
	]
};

var agentlist = {};


// Invert the mappings above mapping each user agent to the caniuse name for
// faster lookup in agent list
Object.keys(agentmappings).forEach(function(caniuseAgentName) {
	agentmappings[caniuseAgentName].forEach(function(userAgentName) {
		agentlist[userAgentName] = caniuseAgentName;
	});
});

/**
 * Return a normalized name for the user agent, if there is no normalized name
 * the name is returned as is, without modification.
 *
 * @param {string} agentname The name of the user agent to normalize.
 * @returns {string} A normalized user agent name.
 */
module.exports = function(agentname) {
	return agentlist[agentname] || agentname;
};

@@ -310,16 +310,67 @@
 ngs = %7B%0A
+%09%22bb%22: %5B%0A%09%09%22blackberry webkit%22,%0A%09%09%22blackberry%22%0A%09%5D,%0A
 %09%22firefo
@@ -798,16 +798,49 @@
 le%22%0A%09%5D,%0A
+%09%22ie%22: %5B%0A%09%09%22ie large screen%22%0A%09%5D,%0A
 %09%22ios_sa

Add blackberry mapping