Skip to content

Commit 2964008

Browse files
author
Evan Jacobs
committed
refactor(types): one more edit to trim down on complexity
1 parent ebe900a commit 2964008

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/system/src/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ export interface TransformValue {
120120
* leading to primitive values (non-objects.)
121121
*/
122122
export type SynthesizedPath<T extends Record<string, unknown>> = {
123-
[P in keyof T]:
124-
| (T[P] extends Record<string, unknown>
125-
? `${string & P}.${SynthesizedPath<T[P]>}`
126-
: `${string & P}`)
127-
| number
123+
[P in keyof T]: P extends string
124+
? T[P] extends Record<string, unknown>
125+
? `${P}.${SynthesizedPath<T[P]>}`
126+
: P
127+
: never
128128
}[keyof T]
129129

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

0 commit comments

Comments
 (0)