File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ function buildPackageJSON() {
5959 delete packageJSON . engines_on_npm ;
6060
6161 const { version } = packageJSON ;
62- const versionMatch = / ^ \d + \. \d + \. \d + - ? ( .* ) ? $ / . exec ( version ) ;
62+ const versionMatch = / ^ \d + \. \d + \. \d + - ? (?< preReleaseTag > .* ) ? $ / . exec ( version ) ;
6363 if ( ! versionMatch ) {
6464 throw new Error ( 'Version does not match semver spec: ' + version ) ;
6565 }
6666
67- const [ , preReleaseTag ] = versionMatch ;
67+ const { preReleaseTag } = versionMatch . groups ;
6868
6969 if ( preReleaseTag != null ) {
7070 const [ tag ] = preReleaseTag . split ( '.' ) ;
Original file line number Diff line number Diff line change @@ -47,14 +47,14 @@ if (!packageJSON.repository || typeof packageJSON.repository.url !== 'string') {
4747 process . exit ( 1 ) ;
4848}
4949
50- const repoURLMatch = / h t t p s : \/ \/ g i t h u b .c o m \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) .g i t / . exec (
50+ const repoURLMatch = / h t t p s : \/ \/ g i t h u b .c o m \/ (?< githubOrg > [ ^ / ] + ) \/ (?< githubRepo > [ ^ / ] + ) .g i t / . exec (
5151 packageJSON . repository . url ,
5252) ;
5353if ( repoURLMatch == null ) {
5454 console . error ( 'Cannot extract organization and repo name from repo URL!' ) ;
5555 process . exit ( 1 ) ;
5656}
57- const [ , githubOrg , githubRepo ] = repoURLMatch ;
57+ const { githubOrg, githubRepo } = repoURLMatch . groups ;
5858
5959getChangeLog ( )
6060 . then ( ( changelog ) => process . stdout . write ( changelog ) )
@@ -275,9 +275,9 @@ function commitsInfoToPRs(commits) {
275275 ( pr ) => pr . repository . nameWithOwner === `${ githubOrg } /${ githubRepo } ` ,
276276 ) ;
277277 if ( associatedPRs . length === 0 ) {
278- const match = / \( # ( [ 0 - 9 ] + ) \) $ / m. exec ( commit . message ) ;
278+ const match = / \( # (?< prNumber > [ 0 - 9 ] + ) \) $ / m. exec ( commit . message ) ;
279279 if ( match ) {
280- prs [ parseInt ( match [ 1 ] , 10 ) ] = true ;
280+ prs [ parseInt ( match . groups . prNumber , 10 ) ] = true ;
281281 continue ;
282282 }
283283 throw new Error (
You can’t perform that action at this time.
0 commit comments