MCPcopy Index your code
hub / github.com/nodejs/node / getCreateSourceFileOptions

Function getCreateSourceFileOptions

test/fixtures/snapshot/typescript.js:118200–118210  ·  view source on GitHub ↗
(fileName, moduleResolutionCache, host, options)

Source from the content-addressed store, hash-verified

118198 return result;
118199 }
118200 function getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options) {
118201 // It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
118202 // and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
118203 // to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
118204 var impliedNodeFormat = getImpliedNodeFormatForFile(toPath(fileName), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
118205 return {
118206 languageVersion: ts.getEmitScriptTarget(options),
118207 impliedNodeFormat: impliedNodeFormat,
118208 setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
118209 };
118210 }
118211 function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
118212 var path = toPath(fileName);
118213 if (useSourceOfProjectReferenceRedirect) {

Callers 2

findSourceFileWorkerFunction · 0.85

Calls 2

toPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…