Skip to content

Commit

Permalink
feat(map): function rename
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Casey <[email protected]>
  • Loading branch information
jonathan-casey committed Oct 18, 2023
1 parent 2d09e53 commit 3bb1c25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/concerto-core/lib/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ class DecoratorManager {
* Rewrites the $class property on decoratorCommandSet classes.
* @private
* @param {*} decoratorCommandSet the DecoratorCommandSet object
* @param {string} replacement the DCS version upgrade target
* @param {string} version the DCS version upgrade target
* @returns {object} the migrated DecoratorCommandSet object
*/
static upMigrateMinorVersion(decoratorCommandSet, replacement) {
static migrateTo(decoratorCommandSet, version) {
if (decoratorCommandSet instanceof Object) {
for (let key in decoratorCommandSet) {
if (key === '$class' && decoratorCommandSet[key].includes('org.accordproject.decoratorcommands')) {
Expand All @@ -176,7 +176,7 @@ class DecoratorManager {
decoratorCommandSet[key] = decoratorCommandSet[key].replace(versionPattern, DCS_VERSION);
}
if (decoratorCommandSet[key] instanceof Object || decoratorCommandSet[key] instanceof Array) {
this.upMigrateMinorVersion(decoratorCommandSet[key], replacement);
this.migrateTo(decoratorCommandSet[key], version);
}
}
}
Expand All @@ -202,7 +202,7 @@ class DecoratorManager {

// if its < the currect DCS_Version, rewrite the $class version to match the supported DCS_VERSION
if (semver.lt(inputVersion, DCS_VERSION)) {
decoratorCommandSet = this.upMigrateMinorVersion(decoratorCommandSet, DCS_VERSION);
decoratorCommandSet = this.migrateTo(decoratorCommandSet, DCS_VERSION);
}

if (options?.validate) {
Expand Down

0 comments on commit 3bb1c25

Please sign in to comment.