mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
APEX-54 Stricter type checking for unsafe_transform functions (#222973)
Address https://github.com/elastic/kibana/issues/216061 Adds an indirection layer in the definition of the `transformFn:`, which forces devs to explicitly define the types of the documents being transformed. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
6aafb4f7f4
commit
852f416a01
18 changed files with 471 additions and 181 deletions
|
@ -104,9 +104,10 @@ export class EsoModelVersionExample
|
|||
changes: [
|
||||
{
|
||||
type: 'unsafe_transform',
|
||||
transformFn: (document) => {
|
||||
return { document };
|
||||
},
|
||||
transformFn: (typeSafeGuard) =>
|
||||
typeSafeGuard((document) => {
|
||||
return { document };
|
||||
}),
|
||||
},
|
||||
],
|
||||
schemas: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue