You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See title.
If we have a object inside a object with an index signature, all paths of the nested objects are getting truncated.
Example:
typeTestType={[index: string]: {a: stringb: number}}// should be string | number | `${string}.a` | `${string}.b`// but is string | numbertypePaths=Path<TestType>
Typescript simplifies unions of string and template literals to only string, which truncates the template literals.
There are ways to fix this (using (string & {}) instead of just string) but these would damage readability of code auto completion or error messages.
The text was updated successfully, but these errors were encountered:
djfhe
changed the title
Paths of nested objects inside object with index singature gets truncated.
Paths of nested objects inside object with index signature gets truncated.
Mar 26, 2023
djfhe
changed the title
Paths of nested objects inside object with index signature gets truncated.
Paths of properties of an object with index signature gets truncated.
Mar 26, 2023
See title.
If we have a object inside a object with an index signature, all paths of the nested objects are getting truncated.
Example:
Typescript simplifies unions of string and template literals to only string, which truncates the template literals.
There are ways to fix this (using
(string & {})
instead of juststring
) but these would damage readability of code auto completion or error messages.The text was updated successfully, but these errors were encountered: