<commit_before>/* global Flash */
import axios from 'axios';
import Store from '../stores/repo_store';
import Api from '../../api';

const RepoService = {
  url: '',
  options: {
    params: {
      format: 'json',
    },
  },
  richExtensionRegExp: /md/,

  checkCurrentBranchIsCommitable() {
    const url = Store.service.refsUrl;
    return axios.get(url, { params: {
      ref: Store.currentBranch,
      search: Store.currentBranch,
    } });
  },

  getRaw(url) {
    return axios.get(url, {
      transformResponse: [res => res],
    });
  },

  buildParams(url = this.url) {
    // shallow clone object without reference
    const params = Object.assign({}, this.options.params);

    if (this.urlIsRichBlob(url)) params.viewer = 'rich';

    return params;
  },
<commit_msg>Add comment about why we need to stop parsing JSON<commit_after>/* global Flash */
import axios from 'axios';
import Store from '../stores/repo_store';
import Api from '../../api';

const RepoService = {
  url: '',
  options: {
    params: {
      format: 'json',
    },
  },
  richExtensionRegExp: /md/,

  checkCurrentBranchIsCommitable() {
    const url = Store.service.refsUrl;
    return axios.get(url, { params: {
      ref: Store.currentBranch,
      search: Store.currentBranch,
    } });
  },

  getRaw(url) {
    return axios.get(url, {
      // Stop Axios from parsing a JSON file into a JS object
      transformResponse: [res => res],
    });
  },

  buildParams(url = this.url) {
    // shallow clone object without reference
    const params = Object.assign({}, this.options.params);

    if (this.urlIsRichBlob(url)) params.viewer = 'rich';

    return params;
  },

{'fraction_non_alphanumeric': 0.14654654654654656, 'fraction_numerical': 0.0, 'mean_word_length': 2.769230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1081132', 'n_tokens_mistral': 535, 'n_tokens_neox': 533, 'n_words': 136}