Skip to content

Commit

Permalink
[8.x] [Chore][OAS] Remove use of `any` in generator lib uti…
Browse files Browse the repository at this point in the history
…lity (#192440) (#192823)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Chore][OAS] Remove use of `any` in generator lib utility
(#192440)](#192440)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-13T09:08:21Z","message":"[Chore][OAS]
Remove use of `any` in generator lib utility (#192440)\n\n##
Summary\r\n\r\nTiny change, using a cast to `Record` instead of relying
on
`any`.","sha":"9c18dfad14b684968263977e27bb59a989444aa1","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","Feature:OAS","v8.16.0"],"title":"[Chore][OAS]
Remove use of `any` in generator lib
utility","number":192440,"url":"https://github.com/elastic/kibana/pull/192440","mergeCommit":{"message":"[Chore][OAS]
Remove use of `any` in generator lib utility (#192440)\n\n##
Summary\r\n\r\nTiny change, using a cast to `Record` instead of relying
on
`any`.","sha":"9c18dfad14b684968263977e27bb59a989444aa1"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192440","number":192440,"mergeCommit":{"message":"[Chore][OAS]
Remove use of `any` in generator lib utility (#192440)\n\n##
Summary\r\n\r\nTiny change, using a cast to `Record` instead of relying
on
`any`.","sha":"9c18dfad14b684968263977e27bb59a989444aa1"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jean-Louis Leysens <[email protected]>
  • Loading branch information
kibanamachine and jloleysens authored Sep 13, 2024
1 parent 0be7933 commit 77b7a0e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const processDiscontinued = (schema: OpenAPIV3.SchemaObject): void => {
};

/** Just for type convenience */
export const deleteField = (schema: Record<any, unknown>, field: string): void => {
delete schema[field];
export const deleteField = (schema: object, field: string): void => {
delete (schema as Record<string, unknown>)[field];
};

export const isAnyType = (schema: OpenAPIV3.SchemaObject): boolean => {
Expand Down

0 comments on commit 77b7a0e

Please sign in to comment.