/**
检测浏览器类型
var $browser = require('spore-kit-env/src/browser');
console.info($browser.chrome);
**/
var $assign = require('spore-kit-obj/src/assign');
var $uaMatch = require('./uaMatch');

var testers = {
	qq: /qq\/([\d\.]+)/i,
	weixin: /micromessenger/i,
	qzone: 'qzone/',
	qqnews: /qqnews\/([\d\.]+)/i,
	qqhouse: /qqhouse/i,
	qqbrowser: /qqbrowser/i,
	chrome: /chrome/i
};

function detect(options, checkers) {
	var conf = $assign({
		ua: ''
	}, options);

	$assign(testers, checkers);

	return $uaMatch(testers, conf.ua, conf);
}

var info = detect();

info.detect = detect;

module.exports = info;

