fix(nuxt3): remove lookbehind for safari support (#3115)

This commit is contained in:
Daniel Roe 2022-02-07 23:42:39 +00:00 committed by GitHub
parent 8056b8e171
commit dabb72ed7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,8 @@ export type RouterViewSlotProps = Parameters<InstanceOf<typeof RouterView>['$slo
const interpolatePath = (route: RouteLocationNormalizedLoaded, match: RouteLocationMatched) => {
return match.path
.replace(/(?<=:\w+)\([^)]+\)/g, '')
.replace(/(?<=:\w+)[?+*]/g, '')
.replace(/(:\w+)\([^)]+\)/g, '$1')
.replace(/(:\w+)[?+*]/g, '$1')
.replace(/:\w+/g, r => route.params[r.slice(1)]?.toString() || '')
}