function getTopScript(value, scripts) {
  let topCount = -1
  /** @type {string|undefined} */
  let topScript
  /** @type {string} */
  let script

  for (script in scripts) {
    if (own.call(scripts, script)) {
      const count = getOccurrence(value, scripts[script])

      if (count > topCount) {
        topCount = count
        topScript = script
      }
    }
  }

  return [topScript, topCount]
}
From `scripts`, get the most occurring expression for
`value`.

@param {string} value
  Value to check.
@param {Record<string, RegExp>} scripts
  Top-Scripts.
@return {[string|undefined, number]}
  Top script and its occurrence percentage.