src/lib/crawler.js
/**
	 * Check user agent string against the regex.
	 */
Check user agent string against the regex.
Check user agent string against the regex .
isCrawler(userAgent = undefined)
	{
		var agent = (typeof userAgent == "undefined" || userAgent == null ? this.userAgent : userAgent);
		agent = agent.replace(this.compiledExclusions, '');
		if ( agent.trim().length == 0 )
		{
			return false;
		}
		var matches = this.compiledRegexList.exec(agent.trim());
		if ( matches )
		{
			this.matches = matches;
		}
		return matches !== null ? (matches.length ? true : false) : false;
	}
isCrawler ( userAgent = undefined ) { var agent = ( typeof userAgent == "undefined" || userAgent == null ? this . userAgent : userAgent ) ; agent = agent . replace ( this . compiledExclusions , '' ) ; if ( agent . trim ( ) . length == 0 ) { return false ; } var matches = this . compiledRegexList . exec ( agent . trim ( ) ) ; if ( matches ) { this . matches = matches ; } return matches !== null ? ( matches . length ? true : false ) : false ; }
Check user agent string against the regex.
Check user agent string against the regex .
// test on compiled regx