<commit_before>import mobx from 'mobx';
import spy from './spy';

export default function dev(store, config) {
  if (typeof window === 'undefined' || !window.devToolsExtension) return store;

  if (mobx.isObservable(store)) {
    spy(store, config);
  } else if (typeof store === 'function') {
    store = class extends store {  // eslint-disable-line no-param-reassign
      constructor(...args) {
        super(...args);
        spy(this, config);
      }
    };
  } else {<commit_msg>Use class name as instance name by default<commit_after>import mobx from 'mobx';
import spy from './spy';

export default function dev(store, config) {
  if (typeof window === 'undefined' || !window.devToolsExtension) return store;

  if (mobx.isObservable(store)) {
    spy(store, config);
  } else if (typeof store === 'function') {
    /* eslint-disable no-param-reassign */
    if (!config) config = {};
    if (!config.name) config.name = store.name;
    store = class extends store {
      constructor(...args) {
        super(...args);
        spy(this, config);
      }
    };
    /* eslint-enable */
  } else {
{'fraction_non_alphanumeric': 0.1546112115732369, 'fraction_numerical': 0.0, 'mean_word_length': 2.897887323943662, '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': '1109996', 'n_tokens_mistral': 339, 'n_tokens_neox': 340, 'n_words': 95}