File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ const projectVersionPairs = [];
99projects . forEach ( ( p ) => {
1010 const fullProjectVersions = readdirSync (
1111 `json-docs/${ p } `
12- ) . filter ( ( v ) => v . match ( / \d + \. \d + \. \d + / ) ) ;
12+ ) . filter ( ( v ) => v . match ( / ^ \d + \. \d + \. \d + ( - [ \w \. ] + ) ? $ / ) ) ;
1313
1414 const projectVersions = fullProjectVersions . map ( ( v ) => {
15- let [ , major , minor ] = v . match ( / ( \d + ) \. ( \d + ) \. \d + / ) ;
15+ let [ , major , minor ] = v . match ( / ^ ( \d + ) \. ( \d + ) \. \d + (?: - [ \w \. ] + ) ? $ / ) ;
1616 return `${ major } .${ minor } ` ;
1717 } ) ;
1818
@@ -21,12 +21,12 @@ projects.forEach((p) => {
2121 uniqueProjectVersions . forEach ( ( uniqVersion ) => {
2222 const sortedPatchVersions = fullProjectVersions
2323 . filter ( ( projectVersion ) => {
24- return semver . satisfies ( projectVersion , uniqVersion ) ;
24+ return projectVersion . startsWith ( uniqVersion + '.' ) ;
2525 } )
26- . sort ( cmp ) ;
27- projectVersionPairs . push ( [ p , sortedPatchVersions [ sortedPatchVersions . length - 1 ] ] )
26+ . sort ( semver . compare ) ;
2827
29- } )
28+ projectVersionPairs . push ( [ p , sortedPatchVersions [ sortedPatchVersions . length - 1 ] ] ) ;
29+ } ) ;
3030} ) ;
3131
3232module . exports = projectVersionPairs ;
You can’t perform that action at this time.
0 commit comments