Skip to content

Commit

Permalink
fix: make locals enumerable
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jun 16, 2023
1 parent 7a20379 commit c36c4fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/astro/src/core/endpoint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function createAPIContext({

// We define a custom property, so we can check the value passed to locals
Object.defineProperty(context, 'locals', {
enumerable: true,
get() {
return Reflect.get(request, clientLocalsSymbol);
},
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/core/render/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export async function createRenderContext(

// We define a custom property, so we can check the value passed to locals
Object.defineProperty(context, 'locals', {
enumerable: true,
get() {
return Reflect.get(request, clientLocalsSymbol);
},
Expand Down

0 comments on commit c36c4fd

Please sign in to comment.