MCPcopy Create free account
hub / github.com/vitest-dev/vitest / resolveModule

Method resolveModule

packages/mocker/src/node/resolver.ts:123–132  ·  view source on GitHub ↗
(rawId: string, resolved: Rollup.PartialResolvedId | null)

Source from the content-addressed store, hash-verified

121 }
122
123 private resolveModule(rawId: string, resolved: Rollup.PartialResolvedId | null) {
124 const id = resolved?.id || rawId
125 const external
126 = !isAbsolute(id) || isModuleDirectory(this.options, id) ? rawId : null
127 return {
128 id,
129 fsPath: cleanUrl(id),
130 external,
131 }
132 }
133}
134
135function isModuleDirectory(config: ServerResolverOptions, path: string) {

Callers 4

resolveMockIdMethod · 0.95
evaluateModuleMethod · 0.80
loadWebAssemblyModuleMethod · 0.80

Calls 2

cleanUrlFunction · 0.90
isModuleDirectoryFunction · 0.85

Tested by

no test coverage detected