{"size": 562, "ext": "js", "max_stars_repo_path": "server/PLService/utils/error.js", "max_stars_repo_name": "l1xiangyi/wxapp-live-demo", "max_stars_repo_stars_event_min_datetime": "2018-02-06T03:53:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-09T11:23:16.000Z", "max_issues_repo_path": "server/PLService/utils/error.js", "max_issues_repo_name": "JemyCheung/wxapp-live-demo", "max_issues_repo_issues_event_min_datetime": "2018-06-27T09:49:49.000Z", "max_issues_repo_issues_event_max_datetime": "2018-06-28T06:37:59.000Z", "max_forks_repo_path": "server/PLService/utils/error.js", "max_forks_repo_name": "JemyCheung/wxapp-live-demo", "max_forks_repo_forks_event_min_datetime": "2018-02-06T03:32:42.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T07:13:08.000Z"}
{"max_stars_count": 167, "max_issues_count": 1, "max_forks_count": 62, "avg_line_length": 23.4166666667, "max_line_length": 65, "alphanum_fraction": 0.6227758007}
/*
 * error.js
 * Copyright (C) 2018 disoul <disoul@DiSouldeMacBook-Pro.local>
 *
 * Distributed under terms of the MIT license.
 */
exports.checkConfig = function(config, fields) {
  if (fields.auth) {
    if (!config.AK || !config.SK) {
      throw new Error('请提供Qiniu认证Config, 缺少AccessKey和SecretKey');
    }
  }

  if (fields.domain) {
    const domainKeys = fields.domain;
    for (let index in domainKeys) {
      const key = domainKeys[index];
      if (!config.domain[key]) {
        throw new Error(`缺少Domain: ${key}, 请设置setDomain`);
      }
    }
  }
}
