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

fix(Exact): fix type when class present #911

Merged
merged 3 commits into from
Jul 13, 2024

Conversation

zorji
Copy link
Contributor

@zorji zorji commented Jul 9, 2024

This is an attempt to fix the issue reported in #909

I previously attempted to fix the issue in #902

My original approach was use JsonObject to determine object with primitive type and assume all types not match are classes. However, I found that JsonObject also rejects normal object containing any class type.

I also can't find a way to reliable determine a class, I used Class<any> but it seems can't detect Date because Date is a built-in type and only interface is available.

What's changed

  • updated the type to leave Function check as is
  • updated the type to return primitive type early to avoid the generated type becomes too complex.

@zorji zorji force-pushed the exact-fix-object-type branch from e8cf644 to ac46efe Compare July 12, 2024 13:26
@zorji zorji marked this pull request as ready for review July 12, 2024 13:27
source/exact.d.ts Outdated Show resolved Hide resolved
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