File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
src/app/pages/Sandbox/SearchDependencies/DependencyHit Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 117117 "codemirror" : " ^5.27.4" ,
118118 "codesandbox-api" : " ^0.0.14" ,
119119 "color" : " ^0.11.4" ,
120+ "compare-versions" : " ^3.1.0" ,
120121 "css-modules-loader-core" : " ^1.1.0" ,
121122 "cssnano" : " ^3.10.0" ,
122123 "debug" : " ^2.6.8" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
22import HomeIcon from 'react-icons/lib/io/home' ;
33import SearchIcon from 'react-icons/lib/go/search' ;
44import { Highlight } from 'react-instantsearch/dom' ;
5+ import compareVersions from 'compare-versions' ;
56
67import Tooltip from 'common/components/Tooltip' ;
78
@@ -59,8 +60,9 @@ export default class DependencyHit extends React.PureComponent {
5960 }
6061 }
6162
62- const versions = Object . keys ( hit . versions ) ;
63- versions . reverse ( ) ;
63+ const versions = Object . keys ( hit . versions ) . sort ( ( a : string , b : string ) =>
64+ compareVersions ( b , a )
65+ ) ;
6466
6567 return (
6668 < Container highlighted = { highlighted } onClick = { onClick } >
Original file line number Diff line number Diff line change @@ -3144,6 +3144,10 @@ compare-func@^1.3.1:
31443144 array-ify "^1.0.0"
31453145 dot-prop "^3.0.0"
31463146
3147+ compare-versions@^3.1.0:
3148+ version "3.1.0"
3149+ resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.1.0.tgz#43310256a5c555aaed4193c04d8f154cf9c6efd5"
3150+
3147315131483152 version "1.0.0"
31493153 resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1"
You can’t perform that action at this time.
0 commit comments