<commit_before>/**
 * polyfills: provides anything related to the browser environment
 * @module internal/polyfills
 */

import Constants from './constants'

const IS_RAF_AVAILABLE = (
  typeof window !== 'undefined'
  && window.requestAnimationFrame
);

const DEFAULT_REQUEST_ANIMATION_FRAME = (
  IS_RAF_AVAILABLE
    ? requestAnimationFrame
    : callback => setTimeout(callback, Constants.MS_PER_ANIMATION_FRAME)
);

const DEFAULT_CANCEL_ANIMATION_FRAME = (
  IS_RAF_AVAILABLE
    ? cancelAnimationFrame
    : clearTimeout
);

const Polyfills = {
  DEFAULT_REQUEST_ANIMATION_FRAME,
  DEFAULT_CANCEL_ANIMATION_FRAME,
};

export default Polyfills;<commit_msg>:art: Added flow types to polyfills module<commit_after>// @flow
/**
 * polyfills: provides anything related to the browser environment
 * @module internal/polyfills
 */

import Constants from './constants'

const IS_RAF_AVAILABLE: boolean = (
  typeof window !== 'undefined'
  && window.requestAnimationFrame
);

const DEFAULT_REQUEST_ANIMATION_FRAME: Function = (
  IS_RAF_AVAILABLE
    ? requestAnimationFrame
    : callback => setTimeout(callback, Constants.MS_PER_ANIMATION_FRAME)
);

const DEFAULT_CANCEL_ANIMATION_FRAME: Function = (
  IS_RAF_AVAILABLE
    ? cancelAnimationFrame
    : clearTimeout
);

const Polyfills = {
  DEFAULT_REQUEST_ANIMATION_FRAME,
  DEFAULT_CANCEL_ANIMATION_FRAME,
};

export default Polyfills;
{'fraction_non_alphanumeric': 0.08351331893448524, 'fraction_numerical': 0.0, 'mean_word_length': 5.205357142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1043322', 'n_tokens_mistral': 441, 'n_tokens_neox': 427, 'n_words': 89}