Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
Indexed
MCP
copy
Index your code
hub
/
github.com/marijnh/Eloquent-JavaScript
/ detectSourceType
Function
detectSourceType
src/client/sandbox.mjs:404–406 ·
view source on GitHub ↗
(code)
Source
from the content-addressed store, hash-verified
402
}
403
404
function
detectSourceType(code) {
405
return
/(^|\n)\s*(im|ex)port\b/.test(code) ?
"module"
:
"script"
406
}
407
408
function
randomID() {
409
return
Math.floor(Math.random() * 0xffffffff).toString(16)
Callers
1
preprocess
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected