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;
|
public readonly patch: string;
|
||||||
|
|
||||||
constructor(public full: string) {
|
constructor(public full: string) {
|
||||||
const [major, minor, ...rest] = full.split('.');
|
const splits = full.split('.');
|
||||||
this.major = major;
|
this.major = splits[0];
|
||||||
this.minor = minor;
|
this.minor = splits[1];
|
||||||
this.patch = rest.join('.');
|
this.patch = splits.slice(2).join('.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,10 +236,10 @@ export class Version {
|
||||||
public readonly patch: string;
|
public readonly patch: string;
|
||||||
|
|
||||||
constructor(public full: string) {
|
constructor(public full: string) {
|
||||||
const [major, minor, ...rest] = full.split('.');
|
const splits = full.split('.');
|
||||||
this.major = major;
|
this.major = splits[0];
|
||||||
this.minor = minor;
|
this.minor = splits[1];
|
||||||
this.patch = rest.join('.');
|
this.patch = splits.slice(2).join('.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,9 @@ export class Version {
|
||||||
public readonly patch: string;
|
public readonly patch: string;
|
||||||
|
|
||||||
constructor(public full: string) {
|
constructor(public full: string) {
|
||||||
const [major, minor, ...rest] = full.split('.');
|
this.major = full.split('.')[0];
|
||||||
this.major = major;
|
this.minor = full.split('.')[1];
|
||||||
this.minor = minor;
|
this.patch = full.split('.').slice(2).join('.');
|
||||||
this.patch = rest.join('.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue