<commit_before>import { SupportInfo } from '../support-info';
import { resolve } from 'path';

let startsWith = (s: string, t: string): boolean => s.indexOf(t) === 0;
let endsWith = (s: string, t: string): boolean => s.indexOf(t) === (s.length - t.length);

export function support(dependencies, rootDir: string): SupportInfo {

  let isLegacy = Object.getOwnPropertyNames(dependencies).filter(name => {
    return startsWith(name, 'corespring-') && endsWith(name, '-ng15');
  }).length > 0;

  if (isLegacy) {
    return {
      /** 
       * Note: This is a temporary option only present to handle the
       * MathJax dependency and we plan to remove it.
       */
      externals: {
        js: ['//cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML']
      },
      npmDependencies: {
        'css-loader': '0.9.0',
        'file-loader': '^0.9.0',
        'less-loader': '^2.2.3'
      },
      rules: [
        //Mathquill font support
        {
          test: /font\/.*\.(otf|eot|svg|ttf|woff|woff2)([#?].*)?$/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: "public/font/[name].[ext]"
              }
            }
          ]
        },

        {
          test: /fonts\/.*\.(eot|svg|ttf|woff|woff2)([#?].*)?$/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: "public/fonts/[name].[ext]"
              }
            }
          ]
        },
        /* Ignore other asset links to legacy-component-dependencies */
        {
          test: /.*corespring-legacy-component-dependencies.*\.(svg|png)/,

          include: [
            //libs with a nested reference to component-dependencies
            /.*node_modules\/.*node_modules.*/
          ],
          use: [
            {
              loader: 'file-loader',
              options: {
                emitFile: false,
              }
            }
          ]
        },
        {
          test: /.*corespring-legacy-component-dependencies.*\.(svg|png)/,
          exclude: [
            //libs with a nested reference to component-dependencies
            /.*node_modules\/.*node_modules.*/
          ],
          use: [
            {
              loader: 'file-loader',
              options: {
                name: "public/[path][name].[ext]",
                context: resolve(rootDir, "./node_modules/corespring-legacy-component-dependencies/libs/styles")
              }
            }
          ]
        },
        {
          test: /\/images\/feedback\/.*\.png/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: 'public/images/feedback/[name].[ext]'
              }
            }
          ]
        }
      ]
    }
  }
}
<commit_msg>fix conflict<commit_after>import { SupportInfo } from '../support-info';
import { resolve } from 'path';

let startsWith = (s: string, t: string): boolean => s.indexOf(t) === 0;
let endsWith = (s: string, t: string): boolean => s.indexOf(t) === (s.length - t.length);

export function support(dependencies, rootDir: string): SupportInfo {

  let isLegacy = Object.getOwnPropertyNames(dependencies).filter(name => {
    return startsWith(name, 'corespring-') && endsWith(name, '-ng15');
  }).length > 0;

  if (isLegacy) {
    return {
      /** 
       * Note: This is a temporary option only present to handle the
       * MathJax dependency and we plan to remove it.
       */
      externals: {
        js: ['//cdn.mathjax.org/mathjax/2.7-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML']
      },
      npmDependencies: {
        'css-loader': '0.9.0',
        'file-loader': '^0.9.0',
        'less-loader': '^2.2.3'
      },
      rules: [
        //Mathquill font support
        {
          test: /font\/.*\.(otf|eot|svg|ttf|woff|woff2)([#?].*)?$/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: "public/font/[name].[ext]"
              }
            }
          ]
        },

        {
          test: /fonts\/.*\.(eot|svg|ttf|woff|woff2)([#?].*)?$/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: "public/fonts/[name].[ext]"
              }
            }
          ]
        },
        /* Ignore other asset links to legacy-component-dependencies */
        {
          test: /.*corespring-legacy-component-dependencies.*\.(svg|png)/,

          include: [
            //libs with a nested reference to component-dependencies
            /.*node_modules\/.*node_modules.*/
          ],
          use: [
            {
              loader: 'file-loader',
              options: {
                emitFile: false,
              }
            }
          ]
        },
        {
          test: /.*corespring-legacy-component-dependencies.*\.(svg|png)/,
          exclude: [
            //libs with a nested reference to component-dependencies
            /.*node_modules\/.*node_modules.*/
          ],
          use: [
            {
              loader: 'file-loader',
              options: {
                name: "public/[path][name].[ext]",
                context: resolve(rootDir, "./node_modules/corespring-legacy-component-dependencies/libs/styles")
                context: "./node_modules/corespring-legacy-component-dependencies/libs/styles"
              }
            }
          ]
        },
        {
          test: /\/images\/feedback\/.*\.png/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: 'public/images/feedback/[name].[ext]'
              }
            }
          ]
        }
      ]
    }
  }
}

{'fraction_non_alphanumeric': 0.15511265164644714, 'fraction_numerical': 0.0058925476603119585, 'mean_word_length': 1.3010366826156299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3950919', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1665, 'n_words': 295}