MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / hasIncludes

Function hasIncludes

src/client/code.mjs:207–214  ·  view source on GitHub ↗
(code, include)

Source from the content-addressed store, hash-verified

205}
206
207function hasIncludes(code, include) {
208 if (!include) return code
209
210 let re = /(?:\s|<!--.*?-->)*<script src="([^"]*)"><\/script>/g, m
211 let found = []
212 while (m = re.exec(code)) found.push(m[1])
213 return include.every(s => found.indexOf(s) > -1)
214}
215
216function opt(value, label) {
217 let node = document.createElement("option")

Callers 1

runCodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected