utils/utils.js
function (files, packageFilename) {
  const convertedFiles = _.flatten(Object.keys(files).map(key => {
    if (files[key] === true) return key
    else return files[key]
  }))

  const hasPackageLock = _.includes(convertedFiles, packageFilename.replace('package.json', 'package-lock.json'))
  if (hasPackageLock) return packageFilename.replace('package.json', 'package-lock.json')

  const hasYarnLock = _.includes(convertedFiles, packageFilename.replace('package.json', 'yarn.lock'))
  if (hasYarnLock) return packageFilename.replace('package.json', 'yarn.lock')

  return null
}
function (files, packageFilename) {
  const convertedFiles = _.flatten(Object.keys(files).map(key => {
    if (files[key] === true) return key
    else return files[key]
  }))

  const hasPackageLock = _.includes(convertedFiles, packageFilename.replace('package.json', 'package-lock.json'))
  if (hasPackageLock) return packageFilename.replace('package.json', 'package-lock.json')

  const hasYarnLock = _.includes(convertedFiles, packageFilename.replace('package.json', 'yarn.lock'))
  if (hasYarnLock) return packageFilename.replace('package.json', 'yarn.lock')

  return null
}
'legacy' repoDocs have only true/false set at repository.files['yarn.lock'] ect 'newer' repoDocs have an array (empty or with the paths) packageFilename: path of pckage.json