<commit_before>import { Counter, COUNTER } from './types';
export class StringArrayClass implements Counter {
    private copyOfArray : string [];
    constructor(private strArray: string[]) { this.copyOfArray = this.strArray.slice();}

    getCounter(): COUNTER {
        let length = this.strArray.length;
        return {
            do: (cb: (currentElement : string , index : number , copyOfArray : string[]) => void) => {
                for (var i = 0; i < length; i++) {
                    cb(this.copyOfArray[i] , i , this.copyOfArray);
                }
            }
        }
    }

}<commit_msg>add returns to string array class<commit_after>import { ReturnsOfCounter } from './returnsOfCounterClass';
import { Counter, COUNTER } from './types';
export class StringArrayClass implements Counter {
    private copyOfArray: string[];
    constructor(private strArray: string[]) { this.copyOfArray = this.strArray.slice(); }

    getCounter(): COUNTER {
        let length = this.strArray.length;
        return {
            do: (cb?: (index: number, currentElement: string, copyOfArray: string[]) => string) => {
                let changedArray : string[] = this.copyOfArray;

                for (var i = 0; i < length; i++) {
                    let ret = cb && cb(i, this.copyOfArray[i], this.copyOfArray);
                    changedArray[i] = ret || changedArray[i];
                }
                return (new ReturnsOfCounter<string>(changedArray)).getReturns();
            }

        }
    }

}
{'fraction_non_alphanumeric': 0.1283739302172482, 'fraction_numerical': 0.0013166556945358788, 'mean_word_length': 2.2, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '1744819', 'n_tokens_mistral': 426, 'n_tokens_neox': 402, 'n_words': 108}