Skip to content

Commit

Permalink
fix: avoid replaceAll for platform compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 7, 2022
1 parent 4f46310 commit 3cde549
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function createNitroApp (): NitroApp {
for (const h of handlers) {
let handler = h.lazy ? lazyEventHandler(h.handler as any) : h.handler

const referenceRoute = h.route.replaceAll(/:\w+|\*\*/g, '_')
const referenceRoute = h.route.replace(/:\w+|\*\*/g, '_')
const routeOptions = routerOptions.lookup(referenceRoute) || {}
if (routeOptions.swr) {
handler = cachedEventHandler(handler, {
Expand Down

0 comments on commit 3cde549

Please sign in to comment.