A value of type Outer can be losslessly converted to and from JSON. However, assigning it to a variable of type Jsonifiable won’t compile with TS 5.5.2 and type-fest@4.20.1 Playground link:
declare const outer: Outer
let jsonifiable: Jsonifiable = outer
// ^ Type 'Outer' is not assignable to type 'Jsonifiable'.
// Type 'Outer' is not assignable to type '{ [x: string]: Jsonifiable | undefined; }'.
// Index signature for type 'string' is missing in type 'Outer'.(2322)
I believe the assignment should be valid.
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.
Consider this simple nested data structure:
A value of type
Outer
can be losslessly converted to and from JSON. However, assigning it to a variable of typeJsonifiable
won’t compile with TS 5.5.2 and type-fest@4.20.1 Playground link:I believe the assignment should be valid.
Upvote & Fund