From 4d584aca73a88d4531931b0016db5cb60fcb77f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pla=C4=8Dek?= <11457665+urugator@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:26:27 +0200 Subject: [PATCH] simplify function signature --- src/dsl/openapi-builder30.ts | 12 ++---------- src/dsl/openapi-builder31.ts | 16 ++++------------ 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/dsl/openapi-builder30.ts b/src/dsl/openapi-builder30.ts index acccd5a..d2b66b4 100644 --- a/src/dsl/openapi-builder30.ts +++ b/src/dsl/openapi-builder30.ts @@ -46,16 +46,8 @@ export class OpenApiBuilder { return JSON.stringify(this.rootDoc, replacer, space); } getSpecAsYaml( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - replacer?: any[] | ((key: any, value: any) => unknown) | null, - options?: - | string - | number - | (yaml.DocumentOptions & - yaml.SchemaOptions & - yaml.ParseOptions & - yaml.CreateNodeOptions & - yaml.ToStringOptions) + replacer?: Parameters[1], + options?: Parameters[2] ): string { return yaml.stringify(this.rootDoc, replacer, options); } diff --git a/src/dsl/openapi-builder31.ts b/src/dsl/openapi-builder31.ts index 8ece78a..63fd55a 100644 --- a/src/dsl/openapi-builder31.ts +++ b/src/dsl/openapi-builder31.ts @@ -45,17 +45,9 @@ export class OpenApiBuilder { ): string { return JSON.stringify(this.rootDoc, replacer, space); } - getSpecAsYaml( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - replacer?: any[] | ((key: any, value: any) => unknown) | null, - options?: - | string - | number - | (yaml.DocumentOptions & - yaml.SchemaOptions & - yaml.ParseOptions & - yaml.CreateNodeOptions & - yaml.ToStringOptions) + getSpecAsYaml( + replacer?: Parameters[1], + options?: Parameters[2] ): string { return yaml.stringify(this.rootDoc, replacer, options); } @@ -193,4 +185,4 @@ export class OpenApiBuilder { this.rootDoc.webhooks[webhook] = webhookItem; return this; } -} +} \ No newline at end of file