<commit_before>import { Converter } from './converter';
import { Parser } from '../parser';
import { Utils } from '../utils';

export class ConverterBuffer extends Converter {
  private inputBuffers: Buffer[];

  constructor(inputBuffers: Buffer[], options?: IOptions) {
    super(options);
    this.inputBuffers = inputBuffers;
  }

  public getData(): Promise<any> {
    if (this.options && this.options.type === 'array') {
     return Promise.resolve(this.getArray());
    } else {
     return Promise.resolve(this.getStructured());
    }
  }


  public getContent(): string {
    let contents = this.inputBuffers.map((buffer: Buffer) => buffer.toString());
    return contents.join('\n');
  }
}<commit_msg>to use an enum<commit_after>import { Converter } from './converter';
import { Parser } from '../parser';
import { Utils } from '../utils';

const Types = {
  STRUCTURED: 'structured',
  ARRAY: 'array'
};

export class ConverterBuffer extends Converter {
  private inputBuffers: Buffer[];

  constructor(inputBuffers: Buffer[], options?: IOptions) {
    super(options);
    this.inputBuffers = inputBuffers;
  }

  public getData(): Promise<any> {
    if (this.options && this.options.type === Types.ARRAY) {
      return Promise.resolve(this.getArray());
    } else {
      return Promise.resolve(this.getStructured());
    }
  }


  public getContent(): string {
    let contents = this.inputBuffers.map((buffer: Buffer) => buffer.toString());
    return contents.join('\n');
  }
}
{'fraction_non_alphanumeric': 0.1554959785522788, 'fraction_numerical': 0.0, 'mean_word_length': 3.6802507836990594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4923071', 'n_tokens_mistral': 449, 'n_tokens_neox': 442, 'n_words': 107}