From bfee167bc7f618e17df802eac0961103e8220986 Mon Sep 17 00:00:00 2001 From: matthyk <53833818+matthyk@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:54:21 +0100 Subject: [PATCH] fix linting errors --- index.d.ts | 6 +++--- test/types/index.test-d.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/index.d.ts b/index.d.ts index 87bc8a1..5069b04 100644 --- a/index.d.ts +++ b/index.d.ts @@ -64,9 +64,9 @@ export interface OverviewStructure[], decorators?: { - decorate: (Omit> & ExtractDecoratorType )[], - decorateRequest: (Omit> & ExtractDecoratorType )[], - decorateReply: (Omit> & ExtractDecoratorType )[] + decorate: (Omit> & ExtractDecoratorType)[], + decorateRequest: (Omit> & ExtractDecoratorType)[], + decorateReply: (Omit> & ExtractDecoratorType)[] }, hooks?: OverviewStructureHooks, routes?: (Omit & T)[] diff --git a/test/types/index.test-d.ts b/test/types/index.test-d.ts index 630e54a..5934d61 100644 --- a/test/types/index.test-d.ts +++ b/test/types/index.test-d.ts @@ -59,12 +59,12 @@ app } else { return {} } - } + } }) .after((_) => { const data = app.overview<{}, { embedded: string[] }>() - expectType>(data) + expectType>(data) expectAssignable<{ type: string, name: string, embedded: string[] }>(data.decorators!.decorate[0]!) expectAssignable<{ type: string, name: string, embedded: string[] }>(data.decorators!.decorateRequest[0]!) expectAssignable<{ type: string, name: string, embedded: string[] }>(data.decorators!.decorateReply[0]!) @@ -75,17 +75,17 @@ app .register(fastifyOverview, { onDecorateDefinition: (type, name, value) => { if (type === 'decorate') { - if (typeof value === 'object' && !Array.isArray( value )) { + if (typeof value === 'object' && !Array.isArray(value)) { return { - embedded: Object.keys( value ?? {} ) + embedded: Object.keys(value ?? {}) } } else { return {} } } else if (type === 'decorateRequest') { - if (typeof value === 'object' && !Array.isArray( value )) { + if (typeof value === 'object' && !Array.isArray(value)) { return { - recursiveNum: Object.keys( value ?? {} ).length + recursiveNum: Object.keys(value ?? {}).length } } else { return {}