diff --git a/src/parse/module.ts b/src/parse/module.ts index 8d81fc49..8646aede 100644 --- a/src/parse/module.ts +++ b/src/parse/module.ts @@ -23,9 +23,11 @@ export function parseQuery( ) : ParseOutput { options ??= {}; - const mergeWithGlobalOptions = (data: T) : T => { - if (options.defaultPath) { - data.defaultPath = options.defaultPath; + const mergeWithGlobalOptions = (data?: T) : T => { + if (typeof data !== 'undefined') { + if (options.defaultPath) { + data.defaultPath = options.defaultPath; + } } return data; diff --git a/src/parse/type.ts b/src/parse/type.ts index 544fdf61..7c5010ac 100644 --- a/src/parse/type.ts +++ b/src/parse/type.ts @@ -13,7 +13,7 @@ import { ParseParameterOptions, ParseParameterOutput } from './parameter'; //------------------------------------------------ export type ParseInput = { - [K in `${Parameter}` | `${URLParameter}`]?: any + [K in `${Parameter}` | `${URLParameter}`]?: unknown }; //------------------------------------------------