Skip to content

Commit 4d584ac

Browse files
committed
simplify function signature
1 parent a99c4dd commit 4d584ac

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

src/dsl/openapi-builder30.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,8 @@ export class OpenApiBuilder {
4646
return JSON.stringify(this.rootDoc, replacer, space);
4747
}
4848
getSpecAsYaml(
49-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
50-
replacer?: any[] | ((key: any, value: any) => unknown) | null,
51-
options?:
52-
| string
53-
| number
54-
| (yaml.DocumentOptions &
55-
yaml.SchemaOptions &
56-
yaml.ParseOptions &
57-
yaml.CreateNodeOptions &
58-
yaml.ToStringOptions)
49+
replacer?: Parameters<typeof yaml.stringify>[1],
50+
options?: Parameters<typeof yaml.stringify>[2]
5951
): string {
6052
return yaml.stringify(this.rootDoc, replacer, options);
6153
}

src/dsl/openapi-builder31.ts

+4-12
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,9 @@ export class OpenApiBuilder {
4545
): string {
4646
return JSON.stringify(this.rootDoc, replacer, space);
4747
}
48-
getSpecAsYaml(
49-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
50-
replacer?: any[] | ((key: any, value: any) => unknown) | null,
51-
options?:
52-
| string
53-
| number
54-
| (yaml.DocumentOptions &
55-
yaml.SchemaOptions &
56-
yaml.ParseOptions &
57-
yaml.CreateNodeOptions &
58-
yaml.ToStringOptions)
48+
getSpecAsYaml(
49+
replacer?: Parameters<typeof yaml.stringify>[1],
50+
options?: Parameters<typeof yaml.stringify>[2]
5951
): string {
6052
return yaml.stringify(this.rootDoc, replacer, options);
6153
}
@@ -193,4 +185,4 @@ export class OpenApiBuilder {
193185
this.rootDoc.webhooks[webhook] = webhookItem;
194186
return this;
195187
}
196-
}
188+
}

0 commit comments

Comments
 (0)