From 8f1ce6502bdbfde6179e19c2a27d284a3d1be04e Mon Sep 17 00:00:00 2001 From: thomas-b Date: Fri, 10 Aug 2018 15:56:02 +0200 Subject: [PATCH] [hapi] Correct the server.table() return type --- types/hapi/index.d.ts | 2 +- types/hapi/test/server/server-table.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 23aaf3608c..9f348332ea 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -3790,7 +3790,7 @@ export class Server extends Podium { * * path - the route path. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servertablehost) */ - table(host?: string): Array<{settings: ServerRoute; method: Util.HTTP_METHODS_PARTIAL_LOWERCASE, path: string}>; // TODO I am not sure if the ServerRoute is the object expected here + table(host?: string): RequestRoute[]; } /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/types/hapi/test/server/server-table.ts b/types/hapi/test/server/server-table.ts index ab14938be4..79726118b5 100644 --- a/types/hapi/test/server/server-table.ts +++ b/types/hapi/test/server/server-table.ts @@ -19,4 +19,11 @@ server.route({ server.start(); const table = server.table(); console.log(table); +console.log(table[0].method); +console.log(table[0].path); +console.log(table[0].vhost); +console.log(table[0].realm); +console.log(table[0].settings); +console.log(table[0].fingerprint); +console.log(table[0].auth); console.log('Server started at: ' + server.info.uri);