MCPcopy
hub / github.com/TypeStrong/ts-node / retrieveFile

Function retrieveFile

src/index.ts:817–831  ·  view source on GitHub ↗
(pathOrUrl: string)

Source from the content-addressed store, hash-verified

815 sourceMapSupport.install({
816 environment: 'node',
817 retrieveFile(pathOrUrl: string) {
818 let path = pathOrUrl;
819 // If it's a file URL, convert to local path
820 // Note: fileURLToPath does not exist on early node v10
821 // I could not find a way to handle non-URLs except to swallow an error
822 if (experimentalEsmLoader && path.startsWith('file://')) {
823 try {
824 path = fileURLToPath(path);
825 } catch (e) {
826 /* swallow error */
827 }
828 }
829 path = normalizeSlashes(path);
830 return outputCache.get(path)?.content || '';
831 },
832 redirectConflictingLibrary: true,
833 onConflictingLibraryRedirect(
834 request,

Callers

nothing calls this directly

Calls 2

normalizeSlashesFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…