INNER CODE UNIT · TypeScript
defaultVersion
nodejs/corepack · sources/Engine.ts:337
const defaultVersion = binaryVersion || (() => this.getDefaultVersion(packageManager));
const definition = this.config.definitions[packageManager]!;
// If all leading segments match one of the patterns defined in the `transparent`
// key, we tolerate calling this binary even if the local project isn't explicitly
// configured for it, and we use the special default version if requested.
for (const transparentPath of definition.transparent.commands) {
if (transparentPath[0] === binaryName && transparentPath.slice(1).every((segment, index) => segment === args[index])) {
isTransparentCommand = true;
break;
}
}
const fallbackReference = isTransparentCommand
? definition.transparent.default ?? defaultVersion
: defaultVersion;
fallbackLocator = {