MCPcopy Create free account
hub / github.com/Bewinxed/svetch / getFileFromModulePath

Function getFileFromModulePath

src/utils/util.ts:164–176  ·  view source on GitHub ↗
(project: tsm.Project, modulePath: string)

Source from the content-addressed store, hash-verified

162 * Simplified node type index file resolution.
163 */
164const getFileFromModulePath = (project: tsm.Project, modulePath: string) => {
165 let file = project.getSourceFile(`${modulePath}.ts`);
166 if (!file) {
167 file = project.getSourceFile(`${modulePath}.tsx`);
168 }
169 if (!file) {
170 file = project.getSourceFile(`${modulePath}/index.ts`);
171 }
172 if (!file) {
173 file = project.getSourceFile(`${modulePath}/index.tsx`);
174 }
175 return file;
176};
177
178const _forget = new Set<tsm.ImportTypeNode>();
179

Callers 1

resolveModuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected