diff --git a/packages/animations/src/version.ts b/packages/animations/src/version.ts index ce0a0cd10e..3eca0eb3c8 100644 --- a/packages/animations/src/version.ts +++ b/packages/animations/src/version.ts @@ -23,10 +23,10 @@ export class Version { public readonly patch: string; constructor(public full: string) { - const [major, minor, ...rest] = full.split('.'); - this.major = major; - this.minor = minor; - this.patch = rest.join('.'); + const splits = full.split('.'); + this.major = splits[0]; + this.minor = splits[1]; + this.patch = splits.slice(2).join('.'); } } diff --git a/packages/compiler/src/util.ts b/packages/compiler/src/util.ts index 57fa10fae9..8c62653f09 100644 --- a/packages/compiler/src/util.ts +++ b/packages/compiler/src/util.ts @@ -236,10 +236,10 @@ export class Version { public readonly patch: string; constructor(public full: string) { - const [major, minor, ...rest] = full.split('.'); - this.major = major; - this.minor = minor; - this.patch = rest.join('.'); + const splits = full.split('.'); + this.major = splits[0]; + this.minor = splits[1]; + this.patch = splits.slice(2).join('.'); } } diff --git a/packages/core/src/version.ts b/packages/core/src/version.ts index aea151d90c..71a5cb8878 100644 --- a/packages/core/src/version.ts +++ b/packages/core/src/version.ts @@ -17,10 +17,9 @@ export class Version { public readonly patch: string; constructor(public full: string) { - const [major, minor, ...rest] = full.split('.'); - this.major = major; - this.minor = minor; - this.patch = rest.join('.'); + this.major = full.split('.')[0]; + this.minor = full.split('.')[1]; + this.patch = full.split('.').slice(2).join('.'); } }