diff --git a/test/types/index.ts b/test/types/index.ts index c5d7b2031..bdbf2a800 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -15,6 +15,13 @@ import { const { expect: check } = lab; +type IsAny = ( + unknown extends T + ? [keyof T] extends [never] ? false : true + : false + ); + + declare module '../..' { interface UserCredentials { someId: string; @@ -41,6 +48,8 @@ const genericRoute: ServerRoute = { check.type(request.auth.credentials!.user!); + const y: IsAny = false; + return 'hello!'; } } @@ -109,6 +118,9 @@ const route: ServerRoute = { check.type(request.auth.artifacts.some); check.type(request.auth.artifacts.thing); + const y: IsAny = false; + const z: IsAny = false; + return 'hello!' } }; @@ -171,4 +183,4 @@ server.method('test.add', (a: number, b: number) => a + b, { segment: 'test-segment', }, generateKey: (a: number, b: number) => `${a}${b}` -}); \ No newline at end of file +});