1
0
mirror of synced 2025-12-22 11:26:57 -05:00

Pretty format (#20352)

* Update prettier flow to include JS

* Run prettier

* ...run prettier
This commit is contained in:
Kevin Heis
2021-07-14 14:35:01 -07:00
committed by GitHub
parent ae3db795f4
commit 8a56437c93
333 changed files with 6904 additions and 5350 deletions

View File

@@ -5,17 +5,17 @@ const PR_NUMBER_FORMAT = '(\\d+)'
const ALLOWED_PR_URL_FORMAT = new RegExp(
'^' +
'[\'"]?' +
`https://github\\.com/${USERNAME_FORMAT}/${REPO_NAME_FORMAT}/pull/${PR_NUMBER_FORMAT}` +
'[\'"]?' +
'$'
'[\'"]?' +
`https://github\\.com/${USERNAME_FORMAT}/${REPO_NAME_FORMAT}/pull/${PR_NUMBER_FORMAT}` +
'[\'"]?' +
'$'
)
export default function parsePullRequestUrl (prUrl) {
const [/* fullMatch */, owner, repo, pr] = ((prUrl || '').match(ALLOWED_PR_URL_FORMAT) || [])
export default function parsePullRequestUrl(prUrl) {
const [, /* fullMatch */ owner, repo, pr] = (prUrl || '').match(ALLOWED_PR_URL_FORMAT) || []
return {
owner,
repo,
pullNumber: parseInt(pr, 10) || undefined
pullNumber: parseInt(pr, 10) || undefined,
}
}