<commit_before>
/**
 * Device module.
 * @module base/utils/device
 */

import { pxToInt } from './string'

import detectIt from 'detect-it'

export var deviceType = detectIt.deviceType
export var hasMouse = detectIt.hasMouse
export var hasTouch = detectIt.hasTouch
export var passiveEvents = detectIt.passiveEvents
export var primaryInput = detectIt.primaryInput

/**
 * DeviceInfo class.
 */
export class DeviceInfo {
  constructor(options) {
    this.breakpoints = options.breakpoints || {}
  }

  /** Return breakpoints. */
  get breakpoints() {
    return this._breakpoints
  }

  /**
   * Set breakpoints (pixel values will be converted to integers).
   *
   * @param {Object} breakpoints - Breakpoints
   */
  set breakpoints(breakpoints) {
    var newBreakpoints = {}

    for (let breakpoint in breakpoints) {
      if (breakpoints.hasOwnProperty(breakpoint)) {
        newBreakpoints[breakpoint] = pxToInt(breakpoints[breakpoint])
      }
    }

    this._breakpoints = newBreakpoints
  }

  _checkWhetherBreakpointExists(breakpoint) {
    if (!this._breakpoints[breakpoint]) {
      throw new Error('Breakpoint "'+ breakpoint + '" doesn\'t exist.')
    }
  }

  /**
   * Check if current device width is eqal to the given breakpoint.
   *
   * @param   {String} breakpoint - Breakpoint to check.
   * @returns {Boolean}
   *   `true` if device width is equal to the given breakpoint, otherwise `false`.
   */
  isEqual(breakpoint) {
    this._checkWhetherBreakpointExists(breakpoint)

    return window.innerWidth == this._breakpoints[breakpoint]
  }

  /**
   * Check if current device width is larger than given breakpoint.
   *
   * @param   {String} breakpoint - Breakpoint to check.
   * @returns {Boolean}
   *   `true` if device width is larger than given breakpoint, otherwise `false`.
   */
  isLargerThan(breakpoint) {
    this._checkWhetherBreakpointExists(breakpoint)

    return window.innerWidth > this._breakpoints[breakpoint]<commit_msg>Fix typo<commit_after>
/**
 * Device module.
 * @module base/utils/device
 */

import { pxToInt } from './string'

import detectIt from 'detect-it'

export var deviceType = detectIt.deviceType
export var hasMouse = detectIt.hasMouse
export var hasTouch = detectIt.hasTouch
export var passiveEvents = detectIt.passiveEvents
export var primaryInput = detectIt.primaryInput

/**
 * DeviceInfo class.
 */
export class DeviceInfo {
  constructor(options) {
    this.breakpoints = options.breakpoints || {}
  }

  /** Return breakpoints. */
  get breakpoints() {
    return this._breakpoints
  }

  /**
   * Set breakpoints (pixel values will be converted to integers).
   *
   * @param {Object} breakpoints - Breakpoints
   */
  set breakpoints(breakpoints) {
    var newBreakpoints = {}

    for (let breakpoint in breakpoints) {
      if (breakpoints.hasOwnProperty(breakpoint)) {
        newBreakpoints[breakpoint] = pxToInt(breakpoints[breakpoint])
      }
    }

    this._breakpoints = newBreakpoints
  }

  _checkWhetherBreakpointExists(breakpoint) {
    if (!this._breakpoints[breakpoint]) {
      throw new Error('Breakpoint "'+ breakpoint + '" doesn\'t exist.')
    }
  }

  /**
   * Check if current device width is equal to the given breakpoint.
   *
   * @param   {String} breakpoint - Breakpoint to check.
   * @returns {Boolean}
   *   `true` if device width is equal to the given breakpoint, otherwise `false`.
   */
  isEqual(breakpoint) {
    this._checkWhetherBreakpointExists(breakpoint)

    return window.innerWidth == this._breakpoints[breakpoint]
  }

  /**
   * Check if current device width is larger than given breakpoint.
   *
   * @param   {String} breakpoint - Breakpoint to check.
   * @returns {Boolean}
   *   `true` if device width is larger than given breakpoint, otherwise `false`.
   */
  isLargerThan(breakpoint) {
    this._checkWhetherBreakpointExists(breakpoint)

    return window.innerWidth > this._breakpoints[breakpoint]
{'fraction_non_alphanumeric': 0.10397553516819572, 'fraction_numerical': 0.0, 'mean_word_length': 3.370824053452116, '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': '5244896', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1140, 'n_words': 308}