<commit_before>#!/usr/bin/env node

import {Glob} from 'glob';
import {readFileSync, writeFileSync} from 'fs';
import {normalize} from 'path';

function writeIndex(files: string[]):void{
    const exportExpression= (file: string): string =>{
        const relativePath = file.replace(/(\.ts)$/, '').replace(/\\/g, '/');
        return `export * from '${relativePath}';`;
    };
    const data = files.reduce((result, item) => result += `${exportExpression(item)}\n`, '');
    writeFileSync('./index.ts', data, 'utf8');
}

function updateFiles(files: string[]): void{
    const path = './package.json';
    const isDefinition = new RegExp('\.d.ts$');
    const fileOptions = {encoding: "utf-8"};
    const content = JSON.parse(readFileSync(path, fileOptions));
    content.files = files
        .filter(file=> !isDefinition.test(file))
        .map(file => normalize(file.replace(/(\.ts)$/, '.js')))
        .concat(files
            .filter(file=> !isDefinition.test(file))
            .map(file=> normalize(file.replace(/(\.ts)$/, '.d.ts'))))
        .concat(files
            .filter(file=> isDefinition.test(file))
            .map(file=> normalize(file)))
        .concat(['index.js', 'index.d.ts']);
    writeFileSync(path, JSON.stringify(content, null, 2), 'utf8');
}

new Glob('./lib/**/*.ts', (error:Error, files: string[])=>{
    writeIndex(files);
    updateFiles(files)
});
<commit_msg>The broken build due settings override has been fixed.<commit_after>#!/usr/bin/env node

import {Glob} from 'glob';
import {readFileSync, writeFileSync} from 'fs';
import {normalize} from 'path';

function writeIndex(files: string[]):void{
    const exportExpression= (file: string): string =>{
        const relativePath = file.replace(/(\.ts)$/, '').replace(/\\/g, '/');
        return `export * from '${relativePath}';`;
    };
    const data = files.reduce((result, item) => result += `${exportExpression(item)}\n`, '');
    writeFileSync('./index.ts', data, 'utf8');
}

function updateFiles(files: string[]): void{
    const path = './package.json';
    const isDefinition = new RegExp(/\.d\.ts$/);
    const fileOptions = {encoding: "utf-8"};
    const content = JSON.parse(readFileSync(path, fileOptions));
    content.files = files
        .filter(file=> !isDefinition.test(file))
        .map(file => normalize(file.replace(/(\.ts)$/, '.js')))
        .concat(files
            .filter(file=> !isDefinition.test(file))
            .map(file=> normalize(file.replace(/(\.ts)$/, '.d.ts'))))
        .concat(files
            .filter(file=> isDefinition.test(file))
            .map(file=> normalize(file)))
        .concat(['index.js', 'index.d.ts']);
    writeFileSync(path, JSON.stringify(content, null, 2), 'utf8');
}

new Glob('./lib/**/*.ts', (error:Error, files: string[])=>{
    writeIndex(files);
    updateFiles(files)
});

{'fraction_non_alphanumeric': 0.20803949224259521, 'fraction_numerical': 0.0028208744710860366, 'mean_word_length': 3.2533733133433285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '2460913', 'n_tokens_mistral': 898, 'n_tokens_neox': 885, 'n_words': 190}