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
}