type-fest icon indicating copy to clipboard operation
type-fest copied to clipboard

Jsonify breaks down with JsonValue, JsonObject

Open oleg-codaio opened this issue 1 year ago • 1 comments

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

oleg-codaio avatar Mar 27 '23 17:03 oleg-codaio

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

sindresorhus avatar Mar 28 '23 04:03 sindresorhus