File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,26 @@ export default Ember.Route.extend({
10
10
const controller = this . controllerFor ( this . routeName ) ;
11
11
const maxVersion = crate . get ( 'max_version' ) ;
12
12
13
- const isUnstableVersion = ( version ) => {
14
- const unstableFlags = [ 'alpha' , 'beta' ] ;
13
+ const isUnstableVersion = version => {
14
+ const versionLen = version . length ;
15
+ let majorMinorPatchChars = 0 ;
16
+ let result = false ;
15
17
16
- return unstableFlags . some ( ( flag ) => {
17
- return version . indexOf ( flag ) > - 1 ;
18
- } ) ;
18
+ for ( let i = 0 ; i < versionLen ; i ++ ) {
19
+ const char = version . charAt ( i ) ;
20
+
21
+ if ( ! isNaN ( parseInt ( char ) ) || char === '.' ) {
22
+ majorMinorPatchChars ++ ;
23
+ } else {
24
+ break ;
25
+ }
26
+ }
27
+
28
+ if ( versionLen !== majorMinorPatchChars ) {
29
+ result = true ;
30
+ }
31
+
32
+ return result ;
19
33
} ;
20
34
21
35
// Fallback to the crate's last stable version
You can’t perform that action at this time.
0 commit comments