File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/schematics/update/update Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -32,24 +32,24 @@ type PeerVersionTransform = string | ((range: string) => string);
32
32
// supports 6.0, by adding that compatibility to the range, so it is `^5.0.0 || ^6.0.0`.
33
33
// We export it to allow for testing.
34
34
export function angularMajorCompatGuarantee ( range : string ) {
35
- range = semver . validRange ( range ) ;
36
- if ( range === null ) {
35
+ let newRange = semver . validRange ( range ) ;
36
+ if ( ! newRange ) {
37
37
return range ;
38
38
}
39
39
let major = 1 ;
40
- while ( ! semver . gtr ( major + '.0.0' , range ) ) {
40
+ while ( ! semver . gtr ( major + '.0.0' , newRange ) ) {
41
41
major ++ ;
42
42
if ( major >= 99 ) {
43
43
// Use original range if it supports a major this high
44
44
// Range is most likely unbounded (e.g., >=5.0.0)
45
- return range ;
45
+ return newRange ;
46
46
}
47
47
}
48
48
49
49
// Add the major version as compatible with the angular compatible, with all minors. This is
50
50
// already one major above the greatest supported, because we increment `major` before checking.
51
51
// We add minors like this because a minor beta is still compatible with a minor non-beta.
52
- let newRange = range ;
52
+ newRange = range ;
53
53
for ( let minor = 0 ; minor < 20 ; minor ++ ) {
54
54
newRange += ` || ^${ major } .${ minor } .0-alpha.0 ` ;
55
55
}
You can’t perform that action at this time.
0 commit comments