<commit_before>const insertInlineAd = children => {
  const clonedChildren = [...children];
  const child = clonedChildren.find(item => item.name === "paywall");
  const paragraph = clonedChildren.filter(item => item.name === "paragraph");

  if (!child) {
    return clonedChildren;
  }

  const paywallChildren = child.children;
  const paywallParagraphs = paywallChildren
    .map((item, index) => ({ ...item, index }))
    .filter(item => item.name === "paragraph");
  const paraPostition = [13, 20, 27];

  paraPostition.map((item, i) => {
    // checks if nativeAd only renders once
    const inlineAd = paywallChildren.find(ad => ad.name === `inlineAd${i + 1}`);
    if (inlineAd) {
      return clonedChildren;
    }

    const inlineAdPos = paywallParagraphs[item - paragraph.length]
      ? paywallChildren.splice(
          paywallParagraphs[item - paragraph.length]?.index,
          0,
          {
            name: `inlineAd${i + 1}`,
            children: []
          }
        )
      : null;<commit_msg>feat(scb-1193): add aditional in article ad slots, remove unecessary condition (#2777)<commit_after>const insertInlineAd = children => {
  const clonedChildren = [...children];
  const child = clonedChildren.find(item => item.name === "paywall");
  const paragraph = clonedChildren.filter(item => item.name === "paragraph");

  if (!child) {
    return clonedChildren;
  }

  const paywallChildren = child.children;
  const paywallParagraphs = paywallChildren
    .map((item, index) => ({ ...item, index }))
    .filter(item => item.name === "paragraph");
  const paraPostition = [13, 20, 27];

  paraPostition.map((item, i) => {
    const inlineAdPos = paywallParagraphs[item - paragraph.length]
      ? paywallChildren.splice(
          paywallParagraphs[item - paragraph.length]?.index,
          0,
          {
            name: `inlineAd${i + 1}`,
            children: []
          }
        )
      : null;
{'fraction_non_alphanumeric': 0.14477766287487073, 'fraction_numerical': 0.012926577042399173, 'mean_word_length': 2.764591439688716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '6034362', 'n_tokens_mistral': 602, 'n_tokens_neox': 569, 'n_words': 131}