Skip to content

Commit

Permalink
fix: use deep merge strategy for context and options in Plugin (#1009)
Browse files Browse the repository at this point in the history
* fix: use deep merge strategy for context and options in Plugin (#997)

Fixes #997

* fix: replace custom deep merge with lodash (#997)

Fixes #997
  • Loading branch information
xllily committed Jun 2, 2023
1 parent 22bfb01 commit f0f0cf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/plugin/Plugin.js
Expand Up @@ -40,7 +40,7 @@ class Plugin {
afterRelease() {}

getContext(path) {
const context = Object.assign({}, this.options, this.context);
const context = _.merge({}, this.options, this.context);
return path ? _.get(context, path) : context;
}

Expand Down
2 changes: 1 addition & 1 deletion test/utils.js
Expand Up @@ -94,4 +94,4 @@ test('parseVersion', t => {
t.deepEqual(parseVersion('1.0.0-0'), { version: '1.0.0-0', isPreRelease: true, preReleaseId: null });
t.deepEqual(parseVersion('1.0.0-next.1'), { version: '1.0.0-next.1', isPreRelease: true, preReleaseId: 'next' });
t.deepEqual(parseVersion('21.04.1'), { version: '21.04.1', isPreRelease: false, preReleaseId: null });
});
});

0 comments on commit f0f0cf3

Please sign in to comment.