MCPcopy Create free account
hub / github.com/cure53/DOMPurify / regExpTest

Function regExpTest

src/utils.ts:77–83  ·  view source on GitHub ↗
(regExp: RegExp, value: string)

Source from the content-addressed store, hash-verified

75const regExpTestRaw = RegExp.prototype.test;
76/* Shared /g regexes keep state in lastIndex, so reset it before each test */
77const regExpTest = function (regExp: RegExp, value: string): boolean {
78 if (regExp instanceof RegExp) {
79 regExp.lastIndex = 0;
80 }
81
82 return apply(regExpTestRaw, regExp, [value]);
83};
84
85const typeErrorCreate = unconstruct(TypeError);
86

Callers 14

_neutralizePatchLinkageFunction · 0.85
_fosterTableContentFunction · 0.85
_scrubOwnCharacterDataFunction · 0.85
_isMalformedElementFunction · 0.85
_isUnsafeNodeFunction · 0.85
_matchesNameCheckFunction · 0.85
_sanitizeElementsFunction · 0.85
_isValidAttributeFunction · 0.85
_isBasicCustomElementFunction · 0.85
_isUnsafeAttributeValueFunction · 0.85
_sanitizeAttributesFunction · 0.85
_sanitizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected