<commit_before>import fs = require('mz/fs')
import dirsum from './fs/dirsum'

export default async function untouched (pkgDir: string): Promise<Boolean> {
  const realShasum = await dirsum(pkgDir)
  const originalShasum = await fs.readFile(`${pkgDir}_shasum`, 'utf8')
  return realShasum === originalShasum
}<commit_msg>fix: don't fail when no package shasum is found<commit_after>import fs = require('mz/fs')
import dirsum from './fs/dirsum'

export default async function untouched (pkgDir: string): Promise<Boolean> {
  const realShasum = await dirsum(pkgDir)
  let originalShasum: string | null = null
  try {
    originalShasum = await fs.readFile(`${pkgDir}_shasum`, 'utf8')
  } catch (err) {
    if (err.code !== 'ENOENT') throw err
    return false // for backward compatibility
  }
  return realShasum === originalShasum
}
{'fraction_non_alphanumeric': 0.12154031287605295, 'fraction_numerical': 0.0024067388688327317, 'mean_word_length': 4.818181818181818, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '77309', 'n_tokens_mistral': 271, 'n_tokens_neox': 264, 'n_words': 79}