Revert "refactor(core): optimize calls to `split` and `slice` while computing version parts (#41208)"
This reverts commit 744bd2b64f
.
This commit seems to cause issues in Safari.
This commit is contained in:
parent
eac42e9889
commit
a74eb52589
|
@ -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('.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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('.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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('.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue