<commit_before>'use strict';

module.exports = function transforms() {
  this.replaceInFiles('src/**/*.{js,ts,tsx}', content => {
    // remove es2015 webpack styles imports
    let result = content.replace(/import '.*ss';\n\n?/g, '');
    // remove commonjs webpack styles requires
    result = result.replace(/require\('.*ss'\);\n\n?/g, '');
    // replace commonjs function imports with es2015 imports
    result = result.replace(
      /var (.*) = require\(('.*')\).(.*);/g,
      'import {$1} from $2;'
    );
    // replace commonjs with es2015 imports<commit_msg>Add regex to transform Router, Route and browserHistory imports<commit_after>'use strict';

module.exports = function transforms() {
  this.replaceInFiles('src/**/*.{js,ts,tsx}', content => {
    // replace first occurence of commonjs require of react-router module;
    let result = content.replace(/var ((\w)+) = require\('react-router'\).((\w)+);/, `import {Router, Route, browserHistory} from 'react-router';`);
    // remove other occurences of commonjs require of react-router module
    result = result.replace(/var (.*) = require\(('react-router')\).(.*);\n?/g, '');
    // remove es2015 webpack styles imports
    result = result.replace(/import '.*ss';\n\n?/g, '');
    // remove commonjs webpack styles requires
    result = result.replace(/require\('.*ss'\);\n\n?/g, '');
    // replace commonjs function imports with es2015 imports
    result = result.replace(
      /var (.*) = require\(('.*')\).(.*);/g,
      'import {$1} from $2;'
    );
    // replace commonjs with es2015 imports
{'fraction_non_alphanumeric': 0.1951530612244898, 'fraction_numerical': 0.017857142857142856, 'mean_word_length': 3.217741935483871, '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': '788479', 'n_tokens_mistral': 507, 'n_tokens_neox': 477, 'n_words': 124}