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

JsonObject not limit object keys type #679

Open
Emiyaaaaa opened this issue Sep 5, 2023 · 1 comment
Open

JsonObject not limit object keys type #679

Emiyaaaaa opened this issue Sep 5, 2023 · 1 comment

Comments

@Emiyaaaaa
Copy link
Collaborator

Emiyaaaaa commented Sep 5, 2023

typescript: 5.1.6

type JsonObject not limit Object key type like symbol

const a = {[Symbol(1)]: 1}
function test(v: JsonObject) {}

// issue
test(a) // no ts error, should throw ts error
type b = typeof a extends JsonObject ? true : false // true, should be false

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@Emiyaaaaa Emiyaaaaa changed the title JsonObject not limit object keys type JsonObject not limit object keys type Sep 5, 2023
@Emiyaaaaa
Copy link
Collaborator Author

Emiyaaaaa commented Sep 6, 2023

found this:
microsoft/TypeScript#53265
microsoft/TypeScript#44794

have any way to fix it in type-fast?

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

No branches or pull requests

1 participant