Skip to content

Commit ee2cf8f

Browse files
authored
chore(core): use const for pkg variable in getCandidates (#4161)
* refactor(core): use const for pkg variable in getCandidates * chore: yarn version check --interactive
1 parent cdad990 commit ee2cf8f

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

.yarn/versions/fb518f4e.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
releases:
2+
"@yarnpkg/core": patch
3+
4+
declined:
5+
- "@yarnpkg/plugin-compat"
6+
- "@yarnpkg/plugin-constraints"
7+
- "@yarnpkg/plugin-dlx"
8+
- "@yarnpkg/plugin-essentials"
9+
- "@yarnpkg/plugin-exec"
10+
- "@yarnpkg/plugin-file"
11+
- "@yarnpkg/plugin-git"
12+
- "@yarnpkg/plugin-github"
13+
- "@yarnpkg/plugin-http"
14+
- "@yarnpkg/plugin-init"
15+
- "@yarnpkg/plugin-interactive-tools"
16+
- "@yarnpkg/plugin-link"
17+
- "@yarnpkg/plugin-nm"
18+
- "@yarnpkg/plugin-npm"
19+
- "@yarnpkg/plugin-npm-cli"
20+
- "@yarnpkg/plugin-pack"
21+
- "@yarnpkg/plugin-patch"
22+
- "@yarnpkg/plugin-pnp"
23+
- "@yarnpkg/plugin-pnpm"
24+
- "@yarnpkg/plugin-stage"
25+
- "@yarnpkg/plugin-typescript"
26+
- "@yarnpkg/plugin-version"
27+
- "@yarnpkg/plugin-workspace-tools"
28+
- "@yarnpkg/builder"
29+
- "@yarnpkg/cli"
30+
- "@yarnpkg/doctor"
31+
- "@yarnpkg/nm"
32+
- "@yarnpkg/pnpify"
33+
- "@yarnpkg/sdks"

packages/yarnpkg-core/sources/LockfileResolver.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ export class LockfileResolver implements Resolver {
4242
}
4343

4444
async getCandidates(descriptor: Descriptor, dependencies: unknown, opts: ResolveOptions) {
45-
let pkg = opts.project.originalPackages.get(structUtils.convertDescriptorToLocator(descriptor).locatorHash);
46-
if (pkg)
47-
return [pkg];
45+
const originalPkg = opts.project.originalPackages.get(structUtils.convertDescriptorToLocator(descriptor).locatorHash);
46+
if (originalPkg)
47+
return [originalPkg];
4848

4949
const resolution = opts.project.storedResolutions.get(descriptor.descriptorHash);
5050
if (!resolution)
5151
throw new Error(`Expected the resolution to have been successful - resolution not found`);
5252

53-
pkg = opts.project.originalPackages.get(resolution);
54-
if (!pkg)
53+
const resolvedPkg = opts.project.originalPackages.get(resolution);
54+
if (!resolvedPkg)
5555
throw new Error(`Expected the resolution to have been successful - package not found`);
5656

57-
return [pkg];
57+
return [resolvedPkg];
5858
}
5959

6060
async getSatisfying(descriptor: Descriptor, references: Array<string>, opts: ResolveOptions) {

0 commit comments

Comments
 (0)