From ed87cdb1014064da01195c1c2c1c969a4aabaefb Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 26 Apr 2022 16:03:30 +0200 Subject: [PATCH] fix(core): update --- ts/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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.'); + } + } }