Skip to content

Commit

Permalink
simplify function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
urugator committed Aug 26, 2024
1 parent a99c4dd commit 4d584ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
12 changes: 2 additions & 10 deletions src/dsl/openapi-builder30.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof yaml.stringify>[1],
options?: Parameters<typeof yaml.stringify>[2]
): string {
return yaml.stringify(this.rootDoc, replacer, options);
}
Expand Down
16 changes: 4 additions & 12 deletions src/dsl/openapi-builder31.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof yaml.stringify>[1],
options?: Parameters<typeof yaml.stringify>[2]
): string {
return yaml.stringify(this.rootDoc, replacer, options);
}
Expand Down Expand Up @@ -193,4 +185,4 @@ export class OpenApiBuilder {
this.rootDoc.webhooks[webhook] = webhookItem;
return this;
}
}
}

0 comments on commit 4d584ac

Please sign in to comment.