Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dynamic field types to support dynamic array of objects #2168

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

pooyaj
Copy link
Contributor

@pooyaj pooyaj commented Jul 11, 2024

Updating types to support array of objects:
Screenshot 2024-07-11 at 4 06 40 PM

Note: Since adjusting types to be stricter, had to update the code in a couple of places to make sure the types for the ActionDefinition is accurate

Testing

Testing not required as this is a non-functional change.

@@ -82,16 +85,27 @@ export interface ActionDefinition<
* This is likely going to change as we productionalize the data model and definition object
*/
dynamicFields?: {
[K in keyof Payload]?: Payload[K] extends object
[K in keyof Payload]?: IsArray<Payload[K]> extends never
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some gnarly typescript, but I think I know what it's saying 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, yeah, getting really complex 😵‍💫

@pooyaj pooyaj merged commit f6748a9 into main Jul 11, 2024
11 checks passed
@pooyaj pooyaj deleted the DC-833/update_dynamic_types branch July 11, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants