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

Function regExpTest

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

Source from the content-addressed store, hash-verified

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

Callers 10

_neutralizePatchLinkageFunction · 0.85
_isUnsafeNodeFunction · 0.85
_matchesNameCheckFunction · 0.85
_sanitizeElementsFunction · 0.85
_isValidAttributeFunction · 0.85
_isBasicCustomElementFunction · 0.85
_isUnsafeAttributeValueFunction · 0.85
_sanitizeAttributesFunction · 0.85
createDOMPurifyFunction · 0.85
isRegexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected