MCPcopy Create free account
hub / github.com/caseywebdev/react-list / sanitizeURL

Function sanitizeURL

docs/index.js:4873–4877  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

4871 isJavaScriptProtocol =
4872 /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
4873function sanitizeURL(url) {
4874 return isJavaScriptProtocol.test("" + url)
4875 ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
4876 : url;
4877}
4878var currentReplayingEvent = null;
4879function getEventTarget(nativeEvent) {
4880 nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;

Callers 3

coerceFormActionPropFunction · 0.85
setPropFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…