MCPcopy
hub / github.com/lightningpixel/modly / resolve

Function resolve

scripts/node-ts-extensionless-loader.mjs:1–8  ·  view source on GitHub ↗
(specifier, context, nextResolve)

Source from the content-addressed store, hash-verified

1export async function resolve(specifier, context, nextResolve) {
2 try {
3 return await nextResolve(specifier, context)
4 } catch (error) {
5 if (!shouldRetryWithTypeScriptExtension(specifier, error)) throw error
6 return nextResolve(`${specifier}.ts`, context)
7 }
8}
9
10function shouldRetryWithTypeScriptExtension(specifier, error) {
11 return error?.code === 'ERR_MODULE_NOT_FOUND'

Callers 12

createVenvFunction · 0.85
installRequirementsFunction · 0.85
detectGpuInfoFunction · 0.85
runExtensionSetupFunction · 0.85
setupIpcHandlersFunction · 0.85
ensureReadyMethod · 0.85
handlerMethod · 0.85
runMethod · 0.85
loadModuleFunction · 0.85
requestFunction · 0.85

Calls 1

Tested by 1

loadModuleFunction · 0.68