<commit_before>// Dependencies
var Fs = require("fs")
  , Path = require("path")
  , EngineTools = require("engine-tools")
  ;

// Constants
const PATH_PROJECTS = jxService.paths.projects;

/**
 * readFile
 * Reads a file from project.
 *
 * @name readFile
 * @function
 * @param {Link} link The link object.
 * @return {undefined}
 */
exports.readFile = EngineTools.linkData(function (data, link) {
    if (typeof data.project !== "string" || !data.project) { return link.end(new Error("Project must be a non-empty string.")); }
    if (typeof data.path !== "string" || !data.path) { return link.end(new Error("path must be a non-empty string.")); }
    var path = Path.join(PATH_PROJECTS, data.project, data.path);
    Fs.readFile(path, "utf-8", link.end.bind(link));
};

/**
 * writeFile
 * Reads a file from project.
 *
 * @name writeFile
 * @function
 * @param {Link} link The link object.
 * @return {undefined}
 */
exports.writeFile = EngineTools.linkData(function (data, link) {
    if (typeof data.project !== "string" || !data.project) { return link.end(new Error("Project must be a non-empty string.")); }
    if (typeof data.path !== "string" || !data.path) { return link.end(new Error("path must be a non-empty string.")); }
    if (typeof data.data !== "string") { return link.end(new Error("The file content must be a string.")); }
    var path = Path.join(PATH_PROJECTS, data.project, data.path);
    Fs.writeFile(path, data.data, link.end.bind(link));
});<commit_msg>Fixed syntax<commit_after>// Dependencies
var Fs = require("fs")
  , Path = require("path")
  , EngineTools = require("engine-tools")
  ;

// Constants
const PATH_PROJECTS = jxService.paths.projects;

/**
 * readFile
 * Reads a file from project.
 *
 * @name readFile
 * @function
 * @param {Link} link The link object.
 * @return {undefined}
 */
exports.readFile = EngineTools.linkData(function (data, link) {
    if (typeof data.project !== "string" || !data.project) { return link.end(new Error("Project must be a non-empty string.")); }
    if (typeof data.path !== "string" || !data.path) { return link.end(new Error("path must be a non-empty string.")); }
    var path = Path.join(PATH_PROJECTS, data.project, data.path);
    Fs.readFile(path, "utf-8", link.end.bind(link));
});

/**
 * writeFile
 * Reads a file from project.
 *
 * @name writeFile
 * @function
 * @param {Link} link The link object.
 * @return {undefined}
 */
exports.writeFile = EngineTools.linkData(function (data, link) {
    if (typeof data.project !== "string" || !data.project) { return link.end(new Error("Project must be a non-empty string.")); }
    if (typeof data.path !== "string" || !data.path) { return link.end(new Error("path must be a non-empty string.")); }
    if (typeof data.data !== "string") { return link.end(new Error("The file content must be a string.")); }
    var path = Path.join(PATH_PROJECTS, data.project, data.path);
    Fs.writeFile(path, data.data, link.end.bind(link));
});
{'fraction_non_alphanumeric': 0.17014824797843667, 'fraction_numerical': 0.0006738544474393531, 'mean_word_length': 3.8513071895424837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6294593', 'n_tokens_mistral': 964, 'n_tokens_neox': 955, 'n_words': 273}