MCPcopy Index your code
hub / github.com/dozoisch/react-async-script / getScript

Function getScript

test/async-script-loader-spec.js:13–21  ·  view source on GitHub ↗
(URL, toBoolean = false)

Source from the content-addressed store, hash-verified

11}
12
13const getScript = (URL, toBoolean = false) => {
14 const scripTags = document.getElementsByTagName("script");
15 for (let i = 0; i < scripTags.length; i += 1) {
16 if (scripTags[i].src.indexOf(URL) > -1) {
17 return toBoolean ? true : scripTags[i];
18 }
19 }
20 return toBoolean ? false : undefined;
21};
22
23const hasScript = URL => getScript(URL, true);
24

Callers 4

hasScriptFunction · 0.85
documentLoadScriptFunction · 0.85
documentErrorScriptFunction · 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…