Skip to content

Commit

Permalink
fix: make internal property non enumerable
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 13, 2024
1 parent be68148 commit a8df616
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/router/src/matcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function paramsFromLocation(
export function normalizeRouteRecord(
record: RouteRecordRaw
): RouteRecordNormalized {
return {
const normalized: RouteRecordNormalized = {
path: record.path,
redirect: record.redirect,
name: record.name,
Expand All @@ -400,6 +400,15 @@ export function normalizeRouteRecord(
? record.components || null
: record.component && { default: record.component },
}

// mods contain modules and shouldn't be copied,
// logged or anything. It's just used for internal
// advanced use cases like data loaders
Object.defineProperty(normalized, 'mods', {
value: {},
})

return normalized
}

/**
Expand Down

0 comments on commit a8df616

Please sign in to comment.