Skip to content

Commit

Permalink
fix: remove regex named capture group
Browse files Browse the repository at this point in the history
  • Loading branch information
alicandko committed Aug 18, 2023
1 parent f7f35de commit 057e3d1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ const lookupInEntityMap = (entityMap, linkData) => {
}

const getIdsFromUrn = (urn) => {
// TODO: Use the regex in resource-names package when it's public.
const regExp =
/.*:spaces\/(?<spaceId>[^/]+)(?:\/environments\/(?<environmentId>[^/]+))?\/entries\/(?<entityId>[^/]+)$/
const regExp = /.*:spaces\/([^/]+)(?:\/environments\/([^/]+))?\/entries\/([^/]+)$/

if (!regExp.test(urn)) {
return undefined
Expand Down

0 comments on commit 057e3d1

Please sign in to comment.