From f2cf1da49cc4a647dee9f7a4a5c6bbb7a6f39ab7 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 17 May 2017 01:22:34 +0200 Subject: [PATCH] address comments #2 --- types/hapi/index.d.ts | 2 +- types/hapi/test/route/additional-options.ts | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 4e855f4540..59e7748bc6 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -892,7 +892,7 @@ export interface ServerStartExtConfigurationObject { /** * a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is see ServerExtFunction or see ServerExtRequestHandler */ - method: ServerExtFunction + method: ServerExtFunction | ServerExtFunction[]; options?: ServerExtOptions; } diff --git a/types/hapi/test/route/additional-options.ts b/types/hapi/test/route/additional-options.ts index 124766c721..aaf5a33066 100644 --- a/types/hapi/test/route/additional-options.ts +++ b/types/hapi/test/route/additional-options.ts @@ -20,18 +20,18 @@ var extConfigMulti: Hapi.RouteAdditionalConfigurationOptions = { ext: [{ type: 'onPreAuth', method: function (request, reply) { - reply('ok'); - } - }, { - type: 'onPostAuth', - method: function (request, reply) { - reply('ok'); + reply('ok'); } }, { - type: 'onPostStart', - method: function (server, next) { - next(); - } + type: 'onPostAuth', + method: function (request, reply) { + reply('ok'); + } + }, { + type: 'onPostStart', + method: function (server, next) { + next(); + } }] } @@ -39,7 +39,6 @@ var extConfigMulti: Hapi.RouteAdditionalConfigurationOptions = { const user: Hapi.RouteAdditionalConfigurationOptions = { cache: { expiresIn: 5000, statuses: [200, 201] }, handler: function (request, reply) { - return reply({ name: 'John' }); } };