<commit_before>/* eslint-disable no-console */
const fs = require('fs');
const path = require('path');
const shell = require('shelljs');

function getCommand(watch) {
  const babel = path.join(__dirname, '..', 'node_modules', '.bin', 'babel');

  const ignore = [
    '**/__mocks__/',
    '**/tests/',
    '**/__tests__/',
    '**/*.test.*',
    '**/stories/',
    '**/*.story.*',
    '**/*.stories.*',
    '**/__snapshots__',
    '**/*.d.ts',
  ];

  let args = [
    './src',
    '--out-dir ./dist',
    `--config-file ${path.resolve(__dirname, '../.babelrc.js')}`,
    `--extensions ".js,.jsx,.ts,.tsx"`,
    `--copy-files`,
    `--ignore "${ignore.join('","')}"`,
  ];

  /*
   * angular needs to be compiled with tsc; a compilation with babel is possible but throws
   * runtime errors because of the the babel decorators plugin
   * Copy everything, the cleanup job will remove all ts files afterwards
   */
  if (process.cwd().includes(path.join('app', 'angular'))) {
    args = ['./src', '--out-dir ./dist', '--copy-files'];
  }

  if (watch) {
    args.push('-w');
  }

  return `${babel} ${args.join(' ')}`;
}

function handleExit(code, errorCallback) {
  if (code !== 0) {
    if (errorCallback && typeof errorCallback === 'function') {
      errorCallback();
    }
<commit_msg>Fix js compilation for app/angular<commit_after>/* eslint-disable no-console */
const fs = require('fs');
const path = require('path');
const shell = require('shelljs');

function getCommand(watch) {
  const babel = path.join(__dirname, '..', 'node_modules', '.bin', 'babel');

  const ignore = [
    '**/__mocks__/',
    '**/tests/',
    '**/__tests__/',
    '**/*.test.*',
    '**/stories/',
    '**/*.story.*',
    '**/*.stories.*',
    '**/__snapshots__',
    '**/*.d.ts',
  ];

  const args = [
    './src',
    '--out-dir ./dist',
    `--config-file ${path.resolve(__dirname, '../.babelrc.js')}`,
    `--extensions ".js,.jsx,.ts,.tsx"`,
    `--copy-files`,
    `--ignore "${ignore.join('","')}"`,
  ];

  if (watch) {
    args.push('-w');
  }

  return `${babel} ${args.join(' ')}`;
}

function handleExit(code, errorCallback) {
  if (code !== 0) {
    if (errorCallback && typeof errorCallback === 'function') {
      errorCallback();
    }

{'fraction_non_alphanumeric': 0.24765310683951722, 'fraction_numerical': 0.000894054537326777, 'mean_word_length': 2.786802030456853, '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': '1844961', 'n_tokens_mistral': 795, 'n_tokens_neox': 794, 'n_words': 171}