Robots.js
function formatUserAgent(userAgent) {
	var formattedUserAgent = userAgent.toLowerCase();

	// Strip the version number from robot/1.0 user agents
	var idx = formattedUserAgent.indexOf('/');
	if (idx > -1) {
		formattedUserAgent = formattedUserAgent.substr(0, idx);
	}

	return formattedUserAgent.trim();
}
function formatUserAgent(userAgent) {
	var formattedUserAgent = userAgent.toLowerCase();

	// Strip the version number from robot/1.0 user agents
	var idx = formattedUserAgent.indexOf('/');
	if (idx > -1) {
		formattedUserAgent = formattedUserAgent.substr(0, idx);
	}

	return formattedUserAgent.trim();
}
function formatUserAgent ( userAgent ) { var formattedUserAgent = userAgent . toLowerCase ( ) ; // Strip the version number from robot/1.0 user agents var idx = formattedUserAgent . indexOf ( '/' ) ; if ( idx > - 1 ) { formattedUserAgent = formattedUserAgent . substr ( 0 , idx ) ; } return formattedUserAgent . trim ( ) ; }
Normalises the user-agent string by converting it to
lower case and removing any version numbers.

@param  {string} userAgent
@return {string}
@private
Normalises the user - agent string by converting it to lower case and removing any version numbers .