Skip to content

Commit

Permalink
fix better?
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Dec 22, 2022
1 parent 065bd6b commit 6e1b73e
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>();
});

0 comments on commit 6e1b73e

Please sign in to comment.