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 = [];
9
9
projects . forEach ( ( p ) => {
10
10
const fullProjectVersions = readdirSync (
11
11
`json-docs/${ p } `
12
- ) . filter ( ( v ) => v . match ( / \d + \. \d + \. \d + / ) ) ;
12
+ ) . filter ( ( v ) => v . match ( / ^ \d + \. \d + \. \d + ( - [ \w \. ] + ) ? $ / ) ) ;
13
13
14
14
const projectVersions = fullProjectVersions . map ( ( v ) => {
15
- let [ , major , minor ] = v . match ( / ( \d + ) \. ( \d + ) \. \d + / ) ;
15
+ let [ , major , minor ] = v . match ( / ^ ( \d + ) \. ( \d + ) \. \d + (?: - [ \w \. ] + ) ? $ / ) ;
16
16
return `${ major } .${ minor } ` ;
17
17
} ) ;
18
18
@@ -21,12 +21,12 @@ projects.forEach((p) => {
21
21
uniqueProjectVersions . forEach ( ( uniqVersion ) => {
22
22
const sortedPatchVersions = fullProjectVersions
23
23
. filter ( ( projectVersion ) => {
24
- return semver . satisfies ( projectVersion , uniqVersion ) ;
24
+ return projectVersion . startsWith ( uniqVersion + '.' ) ;
25
25
} )
26
- . sort ( cmp ) ;
27
- projectVersionPairs . push ( [ p , sortedPatchVersions [ sortedPatchVersions . length - 1 ] ] )
26
+ . sort ( semver . compare ) ;
28
27
29
- } )
28
+ projectVersionPairs . push ( [ p , sortedPatchVersions [ sortedPatchVersions . length - 1 ] ] ) ;
29
+ } ) ;
30
30
} ) ;
31
31
32
32
module . exports = projectVersionPairs ;
You can’t perform that action at this time.
0 commit comments