<commit_before>'use strict';

var DOMTokenListSupports = function DOMTokenListSupports(tokenList, token) {
    if (!tokenList || !tokenList.supports) {
        return;
    }
    
    try {
        return tokenList.supports(token);

    } catch (e) {
        if (e instanceof TypeError) {
            console.log("The DOMTokenList doesn't have a supported tokens list");

        } else {
            console.error("Some real shit happened");
        }
    }
};

(function () {
    var preloadList = Array.from(document.querySelectorAll('link[rel="preload"]'));
    var linkSupportsPreload = DOMTokenListSupports(document.createElement("link").relList, "preload");

    var preloadedStyles = preloadList.filter(function (el) {
        return el.as === "style";
    });

    var preloadedScripts = preloadList.filter(function (el) {
        return el.as === "script";
    });

    if (!linkSupportsPreload) {
        preloadedStyles.forEach(function (el) {
            el.rel = 'stylesheet';
            el.removeAttribute('as');
        });

        preloadedScripts.forEach(function (el) {
            var script = document.createElement('script');

            script.src = el.href;
            script.type = 'application/javascript';
            script.defer = true;

            document.head.appendChild(script);
            el.remove();
        });
    }

})();<commit_msg>Format preload-helper.js<commit_after>'use strict';

var DOMTokenListSupports = function DOMTokenListSupports(tokenList, token) {
  if (!tokenList || !tokenList.supports) {
    return;
  }

  try {
    return tokenList.supports(token);

  } catch (e) {
    if (e instanceof TypeError) {
      console.log("The DOMTokenList doesn't have a supported tokens list");

    } else {
      console.error("Some real shit happened: ", e);
    }
  }
};

(function() {
  var preloadList = Array.from(document.querySelectorAll('link[rel="preload"]'));
  var linkSupportsPreload = DOMTokenListSupports(document.createElement("link").relList, "preload");

  var preloadedStyles = preloadList.filter(function (el) {
    return el.as === "style";
  });

  var preloadedScripts = preloadList.filter(function (el) {
    return el.as === "script";
  });

  if (!linkSupportsPreload) {
    preloadedStyles.forEach(function (el) {
      el.rel = 'stylesheet';
      el.removeAttribute('as');
    });

    preloadedScripts.forEach(function (el) {
      var script = document.createElement('script');

      script.src = el.href;
      script.type = 'application/javascript';
      script.defer = true;

      document.head.appendChild(script);
      el.remove();
    });
  }
})();
{'fraction_non_alphanumeric': 0.13960546282245828, 'fraction_numerical': 0.0, 'mean_word_length': 2.788793103448276, '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': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6786127', 'n_tokens_mistral': 782, 'n_tokens_neox': 772, 'n_words': 152}