<commit_before>import { app, deprecate } from 'electron/main';

const binding = process._linkedBinding('electron_browser_crash_reporter');

class CrashReporter {
  start (options: Electron.CrashReporterStartOptions) {
    const {
      productName = app.name,
      companyName,
      extra = {},
      globalExtra = {},
      ignoreSystemCrashHandler = false,
      submitURL,
      uploadToServer = true,
      rateLimit = false,
      compress = true
    } = options || {};

    if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');

    if (!compress) {
      deprecate.log('Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support.');
    }

    const appVersion = app.getVersion();

    if (companyName && globalExtra._companyName == null) globalExtra._companyName = companyName;

    const globalExtraAmended = {
      _productName: productName,
      _version: appVersion,
      ...globalExtra
    };

    binding.start(submitURL, uploadToServer,
      ignoreSystemCrashHandler, rateLimit, compress, globalExtraAmended, extra, false);
  }

  getLastCrashReport () {<commit_msg>chore: Add a condition to crashReporter deprecate log (#27953)<commit_after>import { app, deprecate } from 'electron/main';

const binding = process._linkedBinding('electron_browser_crash_reporter');

class CrashReporter {
  start (options: Electron.CrashReporterStartOptions) {
    const {
      productName = app.name,
      companyName,
      extra = {},
      globalExtra = {},
      ignoreSystemCrashHandler = false,
      submitURL,
      uploadToServer = true,
      rateLimit = false,
      compress = true
    } = options || {};

    if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');

    if (!compress && uploadToServer) {
      deprecate.log('Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support.');
    }

    const appVersion = app.getVersion();

    if (companyName && globalExtra._companyName == null) globalExtra._companyName = companyName;

    const globalExtraAmended = {
      _productName: productName,
      _version: appVersion,
      ...globalExtra
    };

    binding.start(submitURL, uploadToServer,
      ignoreSystemCrashHandler, rateLimit, compress, globalExtraAmended, extra, false);
  }

  getLastCrashReport () {
{'fraction_non_alphanumeric': 0.09229624116114626, 'fraction_numerical': 0.0018608113137327876, 'mean_word_length': 3.4874791318864773, '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': '4802891', 'n_tokens_mistral': 750, 'n_tokens_neox': 715, 'n_words': 219}