{"size": 667, "ext": "js", "max_stars_repo_path": "dbux-babel-plugin/src/helpers/misc.js", "max_stars_repo_name": "MiccWan/dbux", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dbux-babel-plugin/src/helpers/misc.js", "max_issues_repo_name": "MiccWan/dbux", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dbux-babel-plugin/src/helpers/misc.js", "max_forks_repo_name": "MiccWan/dbux", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.1052631579, "max_line_length": 99, "alphanum_fraction": 0.6806596702}
export function getLine(path) {
  const { node: { loc } } = path;

  // loc's type is `SourceLocation`
  // see: https://github.com/babel/babel/tree/master/packages/babel-parser/src/util/location.js#L22

  return loc?.start?.line;
}

export function getPresentableString(path, MaxLen) {
  let presentableString = path.toString();
  if (MaxLen && presentableString.length > MaxLen) {
    presentableString = presentableString.substring(0, MaxLen - 3).trim() + '...';
  }
  presentableString = presentableString
    // .replace(/[\r\n]/g, '')
    .replace(/\s+/g, ' ');      // replace any amount and type of whitespace with a single space
  return presentableString;
}