<commit_before>import mapAF from './mapAF';
import filterAF from './filterAF';
import logAF from './logAF';

const AsyncAF = function AsyncAF(promises) {
  if (!(this instanceof AsyncAF)) return new AsyncAF(promises);
  this.promise = Promise.resolve(promises);
  return this;
};

AsyncAF.prototype.then = function thenAF(resolve, reject) {
  return new AsyncAF(this.promise.then(resolve, reject));
};

AsyncAF.prototype.catch = function catchAF(reject) {
  return this.then(null, reject);
};

AsyncAF.prototype.mapAF = mapAF;

AsyncAF.prototype.filterAF = filterAF;

AsyncAF.logAF = logAF;

export default AsyncAF;<commit_msg>(refactor) refactor back to ES6  syntax while retaining ability to call without<commit_after>import mapAF from './mapAF';
import filterAF from './filterAF';
import logAF from './logAF';

class AsyncAfProto {
  static logAF(...args) {
    return logAF(...`${args}`);
  }
}

class AsyncAF extends AsyncAfProto {
  constructor(promises) {
    super();
    this.value = null;
    if (promises instanceof Promise) {
      Promise.resolve(promises).then(resolved => {
        this.value = resolved;
      });
    }
    if (Array.isArray(promises)) {
      this.value = promises;
    }
  }
}

const AsyncAfCreator = AsyncAF;
// eslint-disable-next-line no-class-assign, no-shadow
AsyncAF = function AsyncAF(...args) {
  return new AsyncAfCreator(...args);
};

AsyncAF.prototype = AsyncAfCreator.prototype;
Object.setPrototypeOf(AsyncAF, AsyncAfCreator);
AsyncAF.prototype.constructor = AsyncAF;

AsyncAfProto.prototype.mapAF = mapAF;

AsyncAfProto.prototype.filterAF = filterAF;

export default AsyncAF;
{'fraction_non_alphanumeric': 0.1287738755391251, 'fraction_numerical': 0.0006161429451632779, 'mean_word_length': 4.205128205128205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1237174', 'n_tokens_mistral': 510, 'n_tokens_neox': 510, 'n_words': 122}