<commit_before>import { add, remove } from 'bianco.events'
import { defaults, router } from 'rawth'
import { has } from 'bianco.attr'

const WINDOW_EVENTS = 'popstate'
const CLICK_EVENT = 'click'
const DOWNLOAD_LINK_ATTRIBUTE = 'download'
const HREF_LINK_ATTRIBUTE = 'href'
const TARGET_SELF_LINK_ATTRIBUTE = '_self'
const LINK_TAG_NAME = 'A'
const HASH = '#'
const RE_ORIGIN = /^.+?\/\/+[^/]+/

const getWindow = () => typeof window === 'undefined' ? null : window
const getDocument = () => typeof document === 'undefined' ? null : document
const getHistorty = () => getWindow() && history
const getLocation = () => {
  const win = getWindow()
  const hist = getHistorty()

  return win && (hist.location || win.location)
}

const onWindowEvent = () => router.push(normalizePath(String(getLocation().href)))
const onRouterPush = path => {
  const url = path.includes(defaults.base) ? path : defaults.base + path
  const loc = getLocation()
  const hist = getHistorty()
  const doc = getDocument()
<commit_msg>Fix 'history' typo<commit_after>import { add, remove } from 'bianco.events'
import { defaults, router } from 'rawth'
import { has } from 'bianco.attr'

const WINDOW_EVENTS = 'popstate'
const CLICK_EVENT = 'click'
const DOWNLOAD_LINK_ATTRIBUTE = 'download'
const HREF_LINK_ATTRIBUTE = 'href'
const TARGET_SELF_LINK_ATTRIBUTE = '_self'
const LINK_TAG_NAME = 'A'
const HASH = '#'
const RE_ORIGIN = /^.+?\/\/+[^/]+/

const getWindow = () => typeof window === 'undefined' ? null : window
const getDocument = () => typeof document === 'undefined' ? null : document
const getHistory = () => getWindow() && history
const getLocation = () => {
  const win = getWindow()
  const hist = getHistory()

  return win && (hist.location || win.location)
}

const onWindowEvent = () => router.push(normalizePath(String(getLocation().href)))
const onRouterPush = path => {
  const url = path.includes(defaults.base) ? path : defaults.base + path
  const loc = getLocation()
  const hist = getHistory()
  const doc = getDocument()

{'fraction_non_alphanumeric': 0.14836795252225518, 'fraction_numerical': 0.0, 'mean_word_length': 4.698591549295775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '441973', 'n_tokens_mistral': 652, 'n_tokens_neox': 645, 'n_words': 176}