Skip to content

Commit

Permalink
fix tuple attributes showing union of tuple in typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mindler-sasu committed Mar 16, 2024
1 parent 61a37ac commit 20e8145
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/typeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ export type ObjectFullPaths<T> =
? IsTuple<T[Key]> extends true
? // If tuple create array concatenate the key, specific array accessor for each index of the tuple, and the rest of the path recursively
| `${Key}`
| `${Key}[${RangeToN<T[Key]["length"]>}]`
| `${Key}[${RangeToN<T[Key]["length"]>}].${ObjectFullPaths<
T[Key][number]
>}`
| `${Key}${ObjectFullPaths<{
[SpecificKey in RangeToN<
T[Key]["length"]
> as `[${SpecificKey}]`]: T[Key][SpecificKey];
}>}`
: // If it's an array concatenate the key, array accessors, and the rest of the path recursively
| `${Key}`
| `${Key}[${number}]`
Expand Down

0 comments on commit 20e8145

Please sign in to comment.