Skip to content

Commit 8eee43d

Browse files
author
Kaylie Kwon
committed
unused property
1 parent dc0cfe6 commit 8eee43d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/cli/commands/install.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ export class Install {
233233
const projectManifestJson = await this.config.readJson(loc);
234234
await normalizeManifest(projectManifestJson, this.config.lockfileFolder, this.config, true);
235235

236-
this._resolutions.init(projectManifestJson.resolutions);
237236
Object.assign(this.resolutions, projectManifestJson.resolutions);
237+
this._resolutions.init(this.resolutions);
238238
Object.assign(manifest, projectManifestJson);
239239

240240
const pushDeps = (depType, manifest: Object, {hint, optional}, isUsed) => {

src/resolutions.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,20 @@ export type ResolutionEntry = {
2929

3030
export default class Resolutions {
3131
constructor(config: Config) {
32-
this._resolutions = map();
3332
this.resolutionsByPackage = map();
3433
this.resolvedPatterns = map();
3534
this.config = config;
3635
this.reporter = config.reporter;
3736
}
3837

39-
_resolutions: ResolutionEntry;
4038
resolutionsByPackage: ResolutionMap;
4139
resolvedPatterns: ResolvedPatternsMap;
4240
config: Config;
4341
reporter: Reporter;
4442

45-
init(resolutions: ResolutionEntry) {
46-
this._resolutions = {...this._resolutions, ...resolutions};
47-
this.resolvedPatterns = map();
48-
49-
Object.keys(this._resolutions).map(pattern => {
50-
const info = this.parsePatternInfo(pattern, this._resolutions[pattern]);
43+
init(resolutions: ?ResolutionEntry = {}) {
44+
Object.keys(resolutions).map(pattern => {
45+
const info = this.parsePatternInfo(pattern, resolutions[pattern]);
5146

5247
if (info) {
5348
const resolution = this.resolutionsByPackage[info.name] || [];

0 commit comments

Comments
 (0)