MCPcopy Create free account
hub / github.com/nodejs/node / getPackageJsonTypesVersionsPaths

Function getPackageJsonTypesVersionsPaths

test/fixtures/snapshot/typescript.js:42474–42489  ·  view source on GitHub ↗
(typesVersions)

Source from the content-addressed store, hash-verified

42472 var typeScriptVersion;
42473 /* @internal */
42474 function getPackageJsonTypesVersionsPaths(typesVersions) {
42475 if (!typeScriptVersion)
42476 typeScriptVersion = new ts.Version(ts.version);
42477 for (var key in typesVersions) {
42478 if (!ts.hasProperty(typesVersions, key))
42479 continue;
42480 var keyRange = ts.VersionRange.tryParse(key);
42481 if (keyRange === undefined) {
42482 continue;
42483 }
42484 // return the first entry whose range matches the current compiler version.
42485 if (keyRange.test(typeScriptVersion)) {
42486 return { version: key, paths: typesVersions[key] };
42487 }
42488 }
42489 }
42490 ts.getPackageJsonTypesVersionsPaths = getPackageJsonTypesVersionsPaths;
42491 function getEffectiveTypeRoots(options, host) {
42492 if (options.typeRoots) {

Callers 1

Calls 1

testMethod · 0.45

Tested by

no test coverage detected