{"size": 493, "ext": "js", "max_stars_repo_path": "src/common/js/level.js", "max_stars_repo_name": "Lufeesang/testForSublime", "max_stars_repo_stars_event_min_datetime": "2017-07-29T06:07:23.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T01:11:05.000Z", "max_issues_repo_path": "src/common/js/level.js", "max_issues_repo_name": "Lufeesang/testForSublime", "max_issues_repo_issues_event_min_datetime": "2017-07-21T12:35:17.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T20:42:02.000Z", "max_forks_repo_path": "src/common/js/level.js", "max_forks_repo_name": "Lufeesang/testForSublime", "max_forks_repo_forks_event_min_datetime": "2017-07-29T06:08:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-23T02:59:51.000Z"}
{"max_stars_count": 1021, "max_issues_count": 29, "max_forks_count": 277, "avg_line_length": 25.9473684211, "max_line_length": 67, "alphanum_fraction": 0.5598377282}
/**
 * [QQ等级计算]
 * 计算规则:1个星星为1级，1个月亮为4级，1个太阳为16级，1个皇冠为64级
 * @param  {number} level [等级]
 * @return {object}   [返回包含皇冠、太阳、月亮、星星个数的对象]
 */
export default (level) => {
	level = level > 150 ? 150 : level < 1 ? 1 : level // QQ最高150级,最低1级
	const crown = ~~(level / 64) // 皇冠数
	const sun = ~~((level - crown * 64) / 16) // 太阳数
	const moon = ~~((level - crown * 64 - sun * 16) / 4) // 月亮数
	const star = ~~(level - crown * 64 - sun * 16 - moon * 4) // 星星数
	return {
		crown,
		sun,
		moon,
		star
	}
}