File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ export class Version {
23
23
public readonly patch : string ;
24
24
25
25
constructor ( public full : string ) {
26
- const [ major , minor , ... rest ] = full . split ( '.' ) ;
27
- this . major = major ;
28
- this . minor = minor ;
29
- this . patch = rest . join ( '.' ) ;
26
+ const splits = full . split ( '.' ) ;
27
+ this . major = splits [ 0 ] ;
28
+ this . minor = splits [ 1 ] ;
29
+ this . patch = splits . slice ( 2 ) . join ( '.' ) ;
30
30
}
31
31
}
32
32
Original file line number Diff line number Diff line change @@ -236,10 +236,10 @@ export class Version {
236
236
public readonly patch : string ;
237
237
238
238
constructor ( public full : string ) {
239
- const [ major , minor , ... rest ] = full . split ( '.' ) ;
240
- this . major = major ;
241
- this . minor = minor ;
242
- this . patch = rest . join ( '.' ) ;
239
+ const splits = full . split ( '.' ) ;
240
+ this . major = splits [ 0 ] ;
241
+ this . minor = splits [ 1 ] ;
242
+ this . patch = splits . slice ( 2 ) . join ( '.' ) ;
243
243
}
244
244
}
245
245
Original file line number Diff line number Diff line change @@ -17,10 +17,9 @@ export class Version {
17
17
public readonly patch : string ;
18
18
19
19
constructor ( public full : string ) {
20
- const [ major , minor , ...rest ] = full . split ( '.' ) ;
21
- this . major = major ;
22
- this . minor = minor ;
23
- this . patch = rest . join ( '.' ) ;
20
+ this . major = full . split ( '.' ) [ 0 ] ;
21
+ this . minor = full . split ( '.' ) [ 1 ] ;
22
+ this . patch = full . split ( '.' ) . slice ( 2 ) . join ( '.' ) ;
24
23
}
25
24
}
26
25
You can’t perform that action at this time.
0 commit comments