<commit_before>var fs = require('fs'),
    urlTools = require('../util/urlTools'),
    seq = require('seq'),
    _ = require('underscore'),
    passError = require('../util/passError');

module.exports = function (fileUrl) {
    var matchJSBUrl = fileUrl.match(/^(.*\/)[^\/]*\.jsb([23])$/);

    if (!matchJSBUrl) {
        throw new Error("resolvers.SenchaJSBuilder: Url must end in .jsb2 or .jsb3: " + url);
    }
    var baseUrl = matchJSBUrl[1],
        jsbVersion = parseInt(matchJSBUrl[2], 10),
        jsbBody = JSON.parse(fs.readFileSync(urlTools.fileUrlToFsPath(fileUrl), 'utf-8')),
        pkgIndex = {};

    if (jsbVersion === 2) {
        jsbBody.packages = jsbBody.pkgs;
        delete jsbBody.pkgs;
    }

    jsbBody.builds = jsbBody.builds || [];

    ['packages', 'builds'].forEach(function (sectionName) {
        if (sectionName in jsbBody) {
            jsbBody[sectionName].forEach(function (pkg) {
                if (jsbVersion === 2) {
                    pkg.packages = pkg.pkgDeps;
                    delete pkg.pkgDeps;
                    pkg.target = pkg.file;
                    delete pkg.file;
                    pkg.files = pkg.fileIncludes.map(function (fileInclude) {
                        return {
                            path: fileInclude.path.replace(/^src\/ext-core/, "../ext-core"), // FIXME
                            name: fileInclude.text
                        };<commit_msg>resolvers.senchaJsBuilder: Fixed very minor typo.<commit_after>var fs = require('fs'),
    urlTools = require('../util/urlTools'),
    seq = require('seq'),
    _ = require('underscore'),
    passError = require('../util/passError');

module.exports = function (fileUrl) {
    var matchJSBUrl = fileUrl.match(/^(.*\/)[^\/]*\.jsb([23])$/);

    if (!matchJSBUrl) {
        throw new Error("resolvers.SenchaJsBuilder: Url must end in .jsb2 or .jsb3: " + url);
    }
    var baseUrl = matchJSBUrl[1],
        jsbVersion = parseInt(matchJSBUrl[2], 10),
        jsbBody = JSON.parse(fs.readFileSync(urlTools.fileUrlToFsPath(fileUrl), 'utf-8')),
        pkgIndex = {};

    if (jsbVersion === 2) {
        jsbBody.packages = jsbBody.pkgs;
        delete jsbBody.pkgs;
    }

    jsbBody.builds = jsbBody.builds || [];

    ['packages', 'builds'].forEach(function (sectionName) {
        if (sectionName in jsbBody) {
            jsbBody[sectionName].forEach(function (pkg) {
                if (jsbVersion === 2) {
                    pkg.packages = pkg.pkgDeps;
                    delete pkg.pkgDeps;
                    pkg.target = pkg.file;
                    delete pkg.file;
                    pkg.files = pkg.fileIncludes.map(function (fileInclude) {
                        return {
                            path: fileInclude.path.replace(/^src\/ext-core/, "../ext-core"), // FIXME
                            name: fileInclude.text
                        };
{'fraction_non_alphanumeric': 0.1487232574189096, 'fraction_numerical': 0.00759144237405107, 'mean_word_length': 1.8172983479105929, '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': '3929974', 'n_tokens_mistral': 935, 'n_tokens_neox': 873, 'n_words': 160}