fix: broken types with array literal and object entries by harlan-zw · Pull Request #96 · unjs/untyped · GitHub
Skip to content

fix: broken types with array literal and object entries#96

Merged
pi0 merged 5 commits into
mainfrom
fix/broken-types-array-object
Jul 28, 2023
Merged

fix: broken types with array literal and object entries#96
pi0 merged 5 commits into
mainfrom
fix/broken-types-array-object

Conversation

@harlan-zw

Copy link
Copy Markdown
Contributor

Issue

nuxt-modules/og-image#48

When we mix literal types with objects, then the generated TS is broken.

Solution

The reason why this fails is because the object type is mapped to an empty string. We need logic to handle this edge-case.

We explicitly check for mixing literals with objects and revert to the object to the default object type.

@harlan-zw harlan-zw requested a review from pi0 June 2, 2023 10:54
@harlan-zw

Copy link
Copy Markdown
Contributor Author

@pi0

pi0 commented Jul 28, 2023

Copy link
Copy Markdown
Member

@pi0 pi0 merged commit 6f1098b into main Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants