<commit_before>/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
// tslint:disable-next-line:no-any
export type TemplateTag = (template: TemplateStringsArray, ...substitutions: any[]) => string;


// tslint:disable-next-line:no-any
export function oneLine(strings: TemplateStringsArray, ...values: any[]) {
  const endResult = String.raw(strings, ...values);

  return endResult.replace(/(?:\n(?:\s*))+/gm, ' ').trim();
}

export function indentBy(indentations: number): TemplateTag {
  let i = '';
  while (indentations--) {
    i += ' ';
  }

  return (strings, ...values) => {
    return stripIndent(strings, ...values)
      .replace(/\n/g, '\n' + i);
  };
}


// tslint:disable-next-line:no-any
export function stripIndent(strings: TemplateStringsArray, ...values: any[]) {
  const endResult = String.raw(strings, ...values);

  // remove the shortest leading indentation from each line
  const match = endResult.match(/^[ \t]*(?=\S)/gm);

  // return early if there's nothing to strip
  if (match === null) {
    return endResult;
  }

  const indent = Math.min(...match.map(el => el.length));
  const regexp = new RegExp('^[ \\t]{' + indent + '}', 'gm');

  return (indent > 0 ? endResult.replace(regexp, '') : endResult).trim();
}


// tslint:disable-next-line:no-any
export function stripIndents(strings: TemplateStringsArray, ...values: any[]) {
  return String.raw(strings, ...values)
    .split('\n')
    .map(line => line.trim())
    .join('\n')
    .trim();<commit_msg>fix(@angular-devkit/core): fix an indentation issue with literals<commit_after>/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
// tslint:disable-next-line:no-any
export type TemplateTag = (template: TemplateStringsArray, ...substitutions: any[]) => string;


// tslint:disable-next-line:no-any
export function oneLine(strings: TemplateStringsArray, ...values: any[]) {
  const endResult = String.raw(strings, ...values);

  return endResult.replace(/(?:\n(?:\s*))+/gm, ' ').trim();
}

export function indentBy(indentations: number): TemplateTag {
  let i = '';
  while (indentations--) {
    i += ' ';
  }

  return (strings, ...values) => {
    return i + stripIndent(strings, ...values).replace(/\n/g, '\n' + i);
  };
}


// tslint:disable-next-line:no-any
export function stripIndent(strings: TemplateStringsArray, ...values: any[]) {
  const endResult = String.raw(strings, ...values);

  // remove the shortest leading indentation from each line
  const match = endResult.match(/^[ \t]*(?=\S)/gm);

  // return early if there's nothing to strip
  if (match === null) {
    return endResult;
  }

  const indent = Math.min(...match.map(el => el.length));
  const regexp = new RegExp('^[ \\t]{' + indent + '}', 'gm');

  return (indent > 0 ? endResult.replace(regexp, '') : endResult).trim();
}


// tslint:disable-next-line:no-any
export function stripIndents(strings: TemplateStringsArray, ...values: any[]) {
  return String.raw(strings, ...values)
    .split('\n')
    .map(line => line.trim())
    .join('\n')
    .trim();
{'fraction_non_alphanumeric': 0.18337850045167117, 'fraction_numerical': 0.0006022282445046673, 'mean_word_length': 3.453083109919571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '5894471', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1051, 'n_words': 279}