<commit_before>'use strict';

const child = require('child_process');
const fs = require('fs');
const path = require('path');
const util = require('util');
const which = require('which');

const debug = util.debuglog('browser_process');

const browsers = {
  chrome: {
    type: 'chrome',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome',
          path.join(process.env['HOME'], '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'),
        ]);
      }

      if (process.platform == 'linux') {
        paths = paths.concat([
          'google-chrome',
        ]);
      }

      if (process.platform == 'win32') {
        paths = paths.concat([
          process.env['LOCALAPPDATA'] + '\\Google\\Chrome\\Application\\chrome.exe',
          process.env['PROGRAMFILES'] + '\\Google\\Chrome\\Application\\chrome.exe',
          process.env['PROGRAMFILES(X86)'] + '\\Google\\Chrome\\Application\\chrome.exe',
        ]);
      }

      return paths;
    }()),
  },

  chromium: {
    type: 'chrome',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          '/Applications/Chromium.app/Contents/MacOS/Chromium',
          path.join(process.env['HOME'], '/Applications/Chromium.app/Contents/MacOS/Chromium'),
        ]);
      }

      if (process.platform == 'linux') {
        paths = paths.concat([
          'chromium-browser',
        ]);
      }

      if (process.platform == 'win32') {
        paths = paths.concat([
          process.env['LOCALAPPDATA'] + '\\Chromium\\Application\\chrome.exe',
          process.env['PROGRAMFILES'] + '\\Chromium\\Application\\chrome.exe',
          process.env['PROGRAMFILES(X86)'] + '\\Chromium\\Application\\chrome.exe',
        ]);
      }

      return paths;
    }()),
  },

  electron: {
    type: 'electron',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          'node_modules/dist/Electron.app/Contents/MacOS/Electron',
          '/Applications/Electron.app/Contents/MacOS/Electron',
          path.join(process.env['HOME'], '/Applications/Electron.app/Contents/MacOS/Electron'),
          'Electron',
        ]);
      }

      if (process.platform == 'linux') {
        paths = paths.concat([
          'node_modules/electron-prebuilt/dist/electron',
        ]);
      }

      if (process.platform == 'win32') {
        paths = paths.concat([
          path.resolve('node_modules\\electron-prebuilt\\dist\\electron.exe'),
        ]);
      }

      return paths;
    }()),
  },

  firefox: {
    type: 'firefox',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          '/Applications/Firefox.app/Contents/MacOS/Firefox',
          path.join(process.env['HOME'], '/Applications/Firefox.app/Contents/MacOS/Firefox'),
        ]);
      }<commit_msg>lib: order paths by specifiy<commit_after>'use strict';

const child = require('child_process');
const fs = require('fs');
const path = require('path');
const util = require('util');
const which = require('which');

const debug = util.debuglog('browser_process');

const browsers = {
  chrome: {
    type: 'chrome',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          path.join(process.env['HOME'], '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'),
          '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome',
        ]);
      }

      if (process.platform == 'linux') {
        paths = paths.concat([
          'google-chrome',
        ]);
      }

      if (process.platform == 'win32') {
        paths = paths.concat([
          process.env['LOCALAPPDATA'] + '\\Google\\Chrome\\Application\\chrome.exe',
          process.env['PROGRAMFILES'] + '\\Google\\Chrome\\Application\\chrome.exe',
          process.env['PROGRAMFILES(X86)'] + '\\Google\\Chrome\\Application\\chrome.exe',
        ]);
      }

      return paths;
    }()),
  },

  chromium: {
    type: 'chrome',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          path.join(process.env['HOME'], '/Applications/Chromium.app/Contents/MacOS/Chromium'),
          '/Applications/Chromium.app/Contents/MacOS/Chromium',
        ]);
      }

      if (process.platform == 'linux') {
        paths = paths.concat([
          'chromium-browser',
        ]);
      }

      if (process.platform == 'win32') {
        paths = paths.concat([
          process.env['LOCALAPPDATA'] + '\\Chromium\\Application\\chrome.exe',
          process.env['PROGRAMFILES'] + '\\Chromium\\Application\\chrome.exe',
          process.env['PROGRAMFILES(X86)'] + '\\Chromium\\Application\\chrome.exe',
        ]);
      }

      return paths;
    }()),
  },

  electron: {
    type: 'electron',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          'node_modules/dist/Electron.app/Contents/MacOS/Electron',
          path.join(process.env['HOME'], '/Applications/Electron.app/Contents/MacOS/Electron'),
          '/Applications/Electron.app/Contents/MacOS/Electron',
          'Electron',
        ]);
      }

      if (process.platform == 'linux') {
        paths = paths.concat([
          'node_modules/electron-prebuilt/dist/electron',
        ]);
      }

      if (process.platform == 'win32') {
        paths = paths.concat([
          path.resolve('node_modules\\electron-prebuilt\\dist\\electron.exe'),
        ]);
      }

      return paths;
    }()),
  },

  firefox: {
    type: 'firefox',
    paths: (function() {
      let paths = [];

      if (process.platform == 'darwin') {
        paths = paths.concat([
          '/Applications/Firefox.app/Contents/MacOS/Firefox',
          path.join(process.env['HOME'], '/Applications/Firefox.app/Contents/MacOS/Firefox'),
        ]);
      }
{'fraction_non_alphanumeric': 0.17747937226985924, 'fraction_numerical': 0.003235722375020223, 'mean_word_length': 2.1460559796437657, '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': '199670', 'n_tokens_mistral': 1936, 'n_tokens_neox': 1820, 'n_words': 284}