<commit_before>'use strict';

function paginatorHelper(options = {}) {
  options = Object.assign({
    base: this.page.base || '',
    current: this.page.current || 0,
    format: `${this.config.pagination_dir}/%d/`,
    total: this.page.total || 1,
    end_size: 1,
    mid_size: 2,
    space: '&hellip;',
    next_text: 'Next',
    prev_text: 'Prev',
    prev_next: true
  }, options);

  const current = options.current;
  const total = options.total;
  const endSize = options.end_size;
  const midSize = options.mid_size;
  const { space, transform } = options;
  const base = options.base;
  const format = options.format;
  const prevText = options.prev_text;
  const nextText = options.next_text;
  const prevNext = options.prev_next;

  if (!current) return '';

  const currentPage = `<span class="page-number current">${transform ? transform(current) : current}</span>`;

  const link = (i) => {
    return this.url_for(i === 1 ? base : base + format.replace('%d', i));
  };

  function pageLink(i) {
    return `<a class="page-number" href="${link(i)}">${transform ? transform(i) : i}</a>`;
  }

  let result = '';
  // Display the link to the previous page
  if (prevNext && current > 1) {
    result += `<a class="extend prev" rel="prev" href="${link(current - 1)}">${prevText}</a>`;
  }

  if (options.show_all) {
    // Display pages on the left side of the current page
    for (let i = 1; i < current; i++) {
      result += pageLink(i);
    }

    // Display the current page
    result += currentPage;

    // Display pages on the right side of the current page
    for (let i = current + 1; i <= total; i++) {
      result += pageLink(i);<commit_msg>Use destructuring assignment<commit_after>'use strict';

function paginatorHelper(options = {}) {
  options = Object.assign({
    base: this.page.base || '',
    current: this.page.current || 0,
    format: `${this.config.pagination_dir}/%d/`,
    total: this.page.total || 1,
    end_size: 1,
    mid_size: 2,
    space: '&hellip;',
    next_text: 'Next',
    prev_text: 'Prev',
    prev_next: true
  }, options);

  const {
    base,
    current,
    format,
    total,
    space,
    transform,
    end_size: endSize,
    mid_size: midSize,
    prev_text: prevText,
    next_text: nextText,
    prev_next: prevNext
  } = options;

  if (!current) return '';

  const currentPage = `<span class="page-number current">${transform ? transform(current) : current}</span>`;

  const link = (i) => {
    return this.url_for(i === 1 ? base : base + format.replace('%d', i));
  };

  function pageLink(i) {
    return `<a class="page-number" href="${link(i)}">${transform ? transform(i) : i}</a>`;
  }

  let result = '';
  // Display the link to the previous page
  if (prevNext && current > 1) {
    result += `<a class="extend prev" rel="prev" href="${link(current - 1)}">${prevText}</a>`;
  }

  if (options.show_all) {
    // Display pages on the left side of the current page
    for (let i = 1; i < current; i++) {
      result += pageLink(i);
    }

    // Display the current page
    result += currentPage;

    // Display pages on the right side of the current page
    for (let i = current + 1; i <= total; i++) {
      result += pageLink(i);
{'fraction_non_alphanumeric': 0.1636645962732919, 'fraction_numerical': 0.0055900621118012426, 'mean_word_length': 3.02625, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '5605970', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1048, 'n_words': 298}