Skip to content

Commit

Permalink
fix: correct regex match for getLoaderRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebilicious committed Aug 29, 2023
1 parent 855a2f0 commit a257c23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/form-actions-nuxt/src/runtime/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getActionRoute(actionPath: string) {
export const addLoaderPrefix = (route: string) => `/${NITRO_LOADER_PREFIX}/${route}`

export function getLoaderRoute(path: string) {
const regex = /\/server\/\.generated\/\.loader\/(.*?)\.get\.ts/
const regex = /server\/\.generated\/\.loader\/(.*?)\.get\.ts/
const loaderRoute = regex.exec(path)?.[1]
if (!loaderRoute) throw new Error(`Could not parse loader route from ${path}`)
return addLoaderPrefix(loaderRoute)
Expand Down

0 comments on commit a257c23

Please sign in to comment.