Skip to content

Commit

Permalink
refactor: optimize regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jun 15, 2024
1 parent a38bc8b commit 3c29fe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/authMatchPolicyResource.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function parseResource(resource) {
const [, region = "*", accountId = "*", restApiId = "*", path = "*"] =
resource.match(
/arn:aws:execute-api(?::([^:\s]+))(?::([^:\s]+))?(?::([^:\s/]+))?(?:\/(.*))?/,
/arn:aws:execute-api:([^\s:]+)(?::([^\s:]+))?(?::([^\s/:]+))?(?:\/(.*))?/,
)

return {
Expand Down

0 comments on commit 3c29fe7

Please sign in to comment.