<commit_before>const fs = require("fs-extra");

function setDefaults(config = {}) {
  const hooks = config.hooks || {};

  return {
    ignore: config.ignore || [],
    commands: config.commands || {
      compile: "truffle compile",
      migrate: "truffle migrate",
      test: "truffle test"
    },
    hooks: {
      "post-unpack": hooks["post-unpack"] || ""
    }
  };
}

function read(path) {
  return fs
    .readFile(path)
    .catch(() => "{}")
    .then(JSON.parse)<commit_msg>fs to fse (lib/config.js)<commit_after>const fse = require("fs-extra");

function setDefaults(config = {}) {
  const hooks = config.hooks || {};

  return {
    ignore: config.ignore || [],
    commands: config.commands || {
      compile: "truffle compile",
      migrate: "truffle migrate",
      test: "truffle test"
    },
    hooks: {
      "post-unpack": hooks["post-unpack"] || ""
    }
  };
}

function read(path) {
  return fse
    .readFile(path)
    .catch(() => "{}")
    .then(JSON.parse)
{'fraction_non_alphanumeric': 0.18421052631578946, 'fraction_numerical': 0.0, 'mean_word_length': 2.718045112781955, 'pattern_counts': {'":': 2, '<': 3, '<?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': '2628718', 'n_tokens_mistral': 335, 'n_tokens_neox': 340, 'n_words': 66}