File tree 2 files changed +6
-6
lines changed 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ function buildPackageJSON() {
59
59
delete packageJSON . engines_on_npm ;
60
60
61
61
const { version } = packageJSON ;
62
- const versionMatch = / ^ \d + \. \d + \. \d + - ? ( .* ) ? $ / . exec ( version ) ;
62
+ const versionMatch = / ^ \d + \. \d + \. \d + - ? (?< preReleaseTag > .* ) ? $ / . exec ( version ) ;
63
63
if ( ! versionMatch ) {
64
64
throw new Error ( 'Version does not match semver spec: ' + version ) ;
65
65
}
66
66
67
- const [ , preReleaseTag ] = versionMatch ;
67
+ const { preReleaseTag } = versionMatch . groups ;
68
68
69
69
if ( preReleaseTag != null ) {
70
70
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') {
47
47
process . exit ( 1 ) ;
48
48
}
49
49
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 (
51
51
packageJSON . repository . url ,
52
52
) ;
53
53
if ( repoURLMatch == null ) {
54
54
console . error ( 'Cannot extract organization and repo name from repo URL!' ) ;
55
55
process . exit ( 1 ) ;
56
56
}
57
- const [ , githubOrg , githubRepo ] = repoURLMatch ;
57
+ const { githubOrg, githubRepo } = repoURLMatch . groups ;
58
58
59
59
getChangeLog ( )
60
60
. then ( ( changelog ) => process . stdout . write ( changelog ) )
@@ -275,9 +275,9 @@ function commitsInfoToPRs(commits) {
275
275
( pr ) => pr . repository . nameWithOwner === `${ githubOrg } /${ githubRepo } ` ,
276
276
) ;
277
277
if ( associatedPRs . length === 0 ) {
278
- const match = / \( # ( [ 0 - 9 ] + ) \) $ / m. exec ( commit . message ) ;
278
+ const match = / \( # (?< prNumber > [ 0 - 9 ] + ) \) $ / m. exec ( commit . message ) ;
279
279
if ( match ) {
280
- prs [ parseInt ( match [ 1 ] , 10 ) ] = true ;
280
+ prs [ parseInt ( match . groups . prNumber , 10 ) ] = true ;
281
281
continue ;
282
282
}
283
283
throw new Error (
You can’t perform that action at this time.
0 commit comments