<commit_before>export function preventTouchMove(e) {
  e.preventDefault();
}

export function allowTouchMove(e) {
  e.stopPropagation();
}

export function preventInertiaScroll() {
  const top = this.scrollTop;
  const totalScroll = this.scrollHeight;
  const currentScroll = top + this.offsetHeight;

  if (top === 0) {
    this.scrollTop = 1;
  } else if (currentScroll === totalScroll) {
    this.scrollTop = top - 1;
  }
}

// `ontouchstart` check works on most browsers
// `maxTouchPoints` works on IE10/11 and Surface
export function isTouchDevice() {
  if (!window) return false;
  return 'ontouchstart' in window || navigator.maxTouchPoints;
}

export function getPadding() {
  if (!document || !window) return 0;

  const currentPadding = parseInt(document.body.paddingRight, 10) || 0;
  const clientWidth = document.body ? document.body.clientWidth : 0;
  const adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;

  return adjustedPadding;
}

export function camelToKebab(str: string): string {
  return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}

export function getWindowHeight(multiplier = 1) {
  if (window && window.innerHeight) {
    return window.innerHeight * multiplier;
  }
}

export function getDocumentHeight() {
  if (document && document.body) {
    return document.body.clientHeight;
  }
}

export function parse(val: number | string): string {
  return isNaN(val) ? val : `${val}px`;
}<commit_msg>Include checks for typeof window for SSR (#31)<commit_after>export function preventTouchMove(e) {
  e.preventDefault();
}

export function allowTouchMove(e) {
  e.stopPropagation();
}

export function preventInertiaScroll() {
  const top = this.scrollTop;
  const totalScroll = this.scrollHeight;
  const currentScroll = top + this.offsetHeight;

  if (top === 0) {
    this.scrollTop = 1;
  } else if (currentScroll === totalScroll) {
    this.scrollTop = top - 1;
  }
}

// `ontouchstart` check works on most browsers
// `maxTouchPoints` works on IE10/11 and Surface
export function isTouchDevice() {
  if (typeof window === 'undefined' || !window) return false;
  return 'ontouchstart' in window || navigator.maxTouchPoints;
}

export function getPadding() {
  if (typeof window === 'undefined' || !window || !document) return 0;

  const currentPadding = parseInt(document.body.paddingRight, 10) || 0;
  const clientWidth = document.body ? document.body.clientWidth : 0;
  const adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;

  return adjustedPadding;
}

export function camelToKebab(str: string): string {
  return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}

export function getWindowHeight(multiplier = 1) {
  if (typeof window !== 'undefined' && window && window.innerHeight) {
    return window.innerHeight * multiplier;
  }
}

export function getDocumentHeight() {
  if (typeof window !== 'undefined' && document && document.body) {
    return document.body.clientHeight;
  }
}

export function parse(val: number | string): string {
  return isNaN(val) ? val : `${val}px`;
}
{'fraction_non_alphanumeric': 0.1326629905935777, 'fraction_numerical': 0.011028219266947779, 'mean_word_length': 4.335640138408304, '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': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2520748', 'n_tokens_mistral': 967, 'n_tokens_neox': 941, 'n_words': 257}