MCPcopy Create free account
hub / github.com/react/react / getQueryParam

Function getQueryParam

fixtures/dom/public/renderer.js:40–49  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

38 }
39
40 function getQueryParam(key) {
41 var pattern = new RegExp(key + '=([^&]+)(&|$)');
42 var matches = window.location.search.match(pattern);
43
44 if (matches) {
45 return decodeURIComponent(matches[1]);
46 }
47
48 handleError(new Error('No key found for' + key));
49 }
50
51 function getBooleanQueryParam(key) {
52 return getQueryParam(key) === 'true';

Callers 2

getBooleanQueryParamFunction · 0.85
renderer.jsFile · 0.85

Calls 1

handleErrorFunction · 0.70

Tested by

no test coverage detected