Skip to content

Commit

Permalink
refactor(types): one more edit to trim down on complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor committed Mar 17, 2023
1 parent ebe900a commit 2964008
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/system/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ export interface TransformValue {
* leading to primitive values (non-objects.)
*/
export type SynthesizedPath<T extends Record<string, unknown>> = {
[P in keyof T]:
| (T[P] extends Record<string, unknown>
? `${string & P}.${SynthesizedPath<T[P]>}`
: `${string & P}`)
| number
[P in keyof T]: P extends string
? T[P] extends Record<string, unknown>
? `${P}.${SynthesizedPath<T[P]>}`
: P
: never
}[keyof T]

export type ThemeNamespaceValue<K extends string, T extends ITheme> =
Expand Down

0 comments on commit 2964008

Please sign in to comment.