<commit_before>import {Injectable} from "@angular/core";
import {theFile} from "./model/file";

@Injectable()
export class formatFileService{
    files: theFile[] = [];

    formatFiles(files: any[]): theFile[]{
        this.files = [];
        for(let file of files){
            this.files.push(this.formatFile(file));
        }
        return this.files;
    }

    formatFile(singlefile: string): theFile{
        let file: theFile = {
                            name : singlefile,
                            content: null,
                            show: false,
                            extension: false
                            };
        return file;
    }
}
<commit_msg>prevent users from opening .gz file<commit_after>import {Injectable} from "@angular/core";
import {theFile} from "./model/file";

@Injectable()
export class formatFileService{
    files: theFile[] = [];

    formatFiles(files: any[]): theFile[]{
        this.files = [];
        for(let file of files){
            this.files.push(this.formatFile(file));
        }
        return this.files;
    }

    formatFile(singlefile: string): theFile{
        let file: theFile = {
                            name : singlefile,
                            content: null,
                            show: false,
                            extension: this.checkExtension(singlefile)
                            };
        return file;
    }

    private checkExtension(filename: string): boolean{
        let parsed: string[] = filename.split(".");
        let len = parsed.length;

        if(parsed[len - 1] == "gz")
            return false;
        else
            return true;
    }
}

{'fraction_non_alphanumeric': 0.11423444976076555, 'fraction_numerical': 0.0005980861244019139, 'mean_word_length': 1.4895833333333333, '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': '647981', 'n_tokens_mistral': 435, 'n_tokens_neox': 432, 'n_words': 106}