static htmlEscape(textOrHtml) {
    if (textOrHtml instanceof SafeHtml) {
      return textOrHtml;
    }
    const textIsObject = typeof textOrHtml == 'object';
    let textAsString;
    if (textIsObject &&
        /** @type {?} */ (textOrHtml).implementsGoogStringTypedString) {
      textAsString =
          /** @type {!TypedString} */ (textOrHtml).getTypedStringValue();
    } else {
      textAsString = String(textOrHtml);
    }
    return SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(
        internal.htmlEscape(textAsString));
  }
Returns HTML-escaped text as a SafeHtml object.

@param {!SafeHtml.TextOrHtml_} textOrHtml The text to escape. If
    the parameter is of type SafeHtml it is returned directly (no escaping
    is done).
@return {!SafeHtml} The escaped text, wrapped as a SafeHtml.
@deprecated Use `safevalues.htmlEscape` instead.