From cd759b1ffcc08635bf584c66d21ca0f5ecc59f61 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Mon, 2 Jul 2018 10:51:13 -0700 Subject: [PATCH] Revert "[@types/hapi] Add null to Request.params and Request.payload" --- types/hapi/index.d.ts | 4 ++-- types/hapi/test/request/parameters.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 26edb16926..d8edc40685 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -424,7 +424,7 @@ export interface Request extends Podium { /** * An object where each key is a path parameter name with matching value as described in [Path parameters](https://github.com/hapijs/hapi/blob/master/API.md#path-parameters). */ - readonly params: Util.Dictionary | null; + readonly params: Util.Dictionary; /** * An array containing all the path params values in the order they appeared in the path. @@ -440,7 +440,7 @@ export interface Request extends Podium { * The request payload based on the route payload.output and payload.parse settings. * TODO check this typing and add references / links. */ - readonly payload: stream.Readable | Buffer | string | object | null; + readonly payload: stream.Readable | Buffer | string | object; /** * Plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. diff --git a/types/hapi/test/request/parameters.ts b/types/hapi/test/request/parameters.ts index 33177d53b4..3f19a02d45 100644 --- a/types/hapi/test/request/parameters.ts +++ b/types/hapi/test/request/parameters.ts @@ -20,7 +20,7 @@ const serverRoute1: ServerRoute = { // Example 2 // http://localhost:8000/person/rafael/fijalkowski const getPerson: Lifecycle.Method = (request, h) => { - const nameParts = request.params ? request.params.name.split('/') : []; + const nameParts = request.params.name.split('/'); return { first: nameParts[0], last: nameParts[1] }; }; const serverRoute2: ServerRoute = {