Reference

@reckona/mreact-shared/url-safety

8 public exports.

Function

FunctionisDangerousHtmlAttributefunction isDangerousHtmlAttribute(name: string): booleanReturns true for HTML attributes that require explicit unsafe-HTML opt-in handling.FunctionisDangerousHtmlOptInfunction isDangerousHtmlOptIn(value: unknown): value is { __html: string }Returns whether a value carries an own string raw HTML data property.FunctionisSrcsetAttributefunction isSrcsetAttribute(name: string): booleanReturns true when an attribute name carries a srcset-style URL list.FunctionisUnsafeMetaRefreshContentfunction isUnsafeMetaRefreshContent(httpEquiv: string, content: string): booleanChecks whether a meta refresh content value redirects to an unsafe URL.FunctionisUnsafeUrlAttributefunction isUnsafeUrlAttribute(name: string, value: string): booleanChecks whether an HTML URL-bearing attribute value uses a blocked scheme.FunctionisUrlAttributefunction isUrlAttribute(name: string): booleanReturns true when an attribute name normally carries a single URL value.FunctionreadDangerousHtmlOptInfunction readDangerousHtmlOptIn(value: unknown): string | undefinedReads an own string data property without invoking the payload's getter.FunctionsafeUrlAttributeValuefunction safeUrlAttributeValue(name: string, value: string): string | undefinedReturns the original URL attribute value when it is safe, otherwise undefined.