diff --git a/ts/index.ts b/ts/index.ts index dbd5fff..ae7de01 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -84,4 +84,17 @@ export class SmartVersion { const newInstance = new SmartVersion(`${this.semver.major + 1}.${this.semver.minor}.${this.semver.patch}`); return newInstance; } + + public getNewVersion(typeArg: 'patch' | 'minor' | 'major') { + switch (typeArg) { + case 'patch': + return this.getNewPatchVersion(); + case 'minor': + return this.getNewMinorVersion(); + case 'major': + return this.getNewMajorVersion(); + default: + throw new Error('unknown new version type.'); + } + } }