Reference
@reckona/mreact-shared/url-safety
7 public exports.
Function
FunctionisDangerousHtmlAttribute
function isDangerousHtmlAttribute(name: string): booleanReturns true for HTML attributes that require explicit unsafe-HTML opt-in handling.FunctionisDangerousHtmlOptInfunction isDangerousHtmlOptIn(value: unknown): value is { __html: string }Narrows a value to an explicit raw HTML opt-in payload.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.FunctionsafeUrlAttributeValuefunction safeUrlAttributeValue(name: string, value: string): string | undefinedReturns the original URL attribute value when it is safe, otherwise undefined.