MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / normalizeImportPath

Function normalizeImportPath

packages/vite/hmr/server/websocket.ts:751–767  ·  view source on GitHub ↗
(spec: string, importerDir: string)

Source from the content-addressed store, hash-verified

749}
750
751function normalizeImportPath(spec: string, importerDir: string): string | null {
752 if (!spec) return null;
753
754 let key: string;
755 if (spec.startsWith('/')) {
756 key = spec;
757 } else if (spec.startsWith('./') || spec.startsWith('../')) {
758 key = path.posix.normalize(path.posix.join(importerDir, spec));
759 if (!key.startsWith('/')) {
760 key = '/' + key;
761 }
762 } else {
763 key = spec;
764 }
765
766 return key.replace(PAT.QUERY_PATTERN, '');
767}
768
769function registerDependencyFile(depFileMap: Map<string, string>, candidate: string | null, fileName: string): void {
770 if (!candidate) return;

Callers 2

replaceVueImportFunction · 0.85

Calls 2

joinMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected