Skip to content

Commit

Permalink
fix(server): use object instead of {} (#3462)
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Dec 23, 2022
1 parent 065bd6b commit 9799a4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/core/internals/config.ts
Expand Up @@ -5,8 +5,8 @@ import { ErrorFormatter } from '../../error/formatter';
* @internal
*/
export interface RootConfigTypes {
ctx: {};
meta: {};
ctx: object;
meta: object;
errorShape: unknown;
transformer: unknown;
}
Expand Down
10 changes: 10 additions & 0 deletions packages/tests/server/regression/issue-3453-meta-interface.test.ts
Expand Up @@ -14,3 +14,13 @@ test('context as interface', () => {
}
initTRPC.context<Context>();
});

test('bad: meta as primitive', () => {
// @ts-expect-error this is not allowed
initTRPC.meta<1>();
});

test('bad: context as primitive', () => {
// @ts-expect-error this is not allowed
initTRPC.context<1>();
});

3 comments on commit 9799a4e

@vercel
Copy link

@vercel vercel bot commented on 9799a4e Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

www – ./www

trpc.io
beta.trpc.io
www.trpc.io
www-git-main-trpc.vercel.app
www-trpc.vercel.app
alpha.trpc.io

@vercel
Copy link

@vercel vercel bot commented on 9799a4e Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

og-image – ./www/og-image

og-image-three-neon.vercel.app
og-image-trpc.vercel.app
og-image.trpc.io
og-image-git-main-trpc.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9799a4e Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-prisma-starter – ./examples/next-prisma-starter

next-prisma-starter-trpc.vercel.app
next-prisma-starter-git-main-trpc.vercel.app
nextjs.trpc.io

Please sign in to comment.