function escapeEntireInlineScriptContent(scriptText: string) {
  if (__DEV__) {
    checkHtmlStringCoercion(scriptText);
  }
  return ('' + scriptText).replace(scriptRegex, scriptReplacer);
}
This escaping function is designed to work with with inline scripts where the entire
contents are escaped. Because we know we are escaping the entire script we can avoid for instance
escaping html comment string sequences that are valid javascript as well because
if there are no sebsequent <script sequences the html parser will never enter
script data double escaped state (see: https://www.w3.org/TR/html53/syntax.html#script-data-double-escaped-state)

While untrusted script content should be made safe before using this api it will
ensure that the script cannot be early terminated or never terminated state