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

Jsonify breaks down with JsonValue, JsonObject #582

Open
oleg-codaio opened this issue Mar 27, 2023 · 1 comment
Open

Jsonify breaks down with JsonValue, JsonObject #582

oleg-codaio opened this issue Mar 27, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@oleg-codaio
Copy link

oleg-codaio commented Mar 27, 2023

I was trying to use Jsonify with a generic class and noticed things would break if I happened to pass in a type already using JsonValue or JsonObject:

// type Foo = {[x: string]: never}
type Foo = Jsonify<JsonObject>

// Type instantiation is excessively deep and possibly infinite.ts(2589)
type Bar = Jsonify<JsonValue>;

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
@sindresorhus
Copy link
Owner

Good catch. We should check for those types and just return the types directly if matched.

@sindresorhus sindresorhus added bug Something isn't working help wanted Extra attention is needed labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants