File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,16 @@ import { isNoUnitNumericStyleProp } from './domAttrConfig'
3
3
4
4
export type NormalizedStyle = Record < string , string | number >
5
5
6
- export function normalizeStyle ( value : unknown ) : NormalizedStyle | undefined {
6
+ export function normalizeStyle (
7
+ value : unknown
8
+ ) : NormalizedStyle | string | undefined {
7
9
if ( isArray ( value ) ) {
8
10
const res : NormalizedStyle = { }
9
11
for ( let i = 0 ; i < value . length ; i ++ ) {
10
12
const item = value [ i ]
11
- const normalized = normalizeStyle (
12
- isString ( item ) ? parseStringStyle ( item ) : item
13
- )
13
+ const normalized = isString ( item )
14
+ ? parseStringStyle ( item )
15
+ : ( normalizeStyle ( item ) as NormalizedStyle )
14
16
if ( normalized ) {
15
17
for ( const key in normalized ) {
16
18
res [ key ] = normalized [ key ]
@@ -19,7 +21,7 @@ export function normalizeStyle(value: unknown): NormalizedStyle | undefined {
19
21
}
20
22
return res
21
23
} else if ( isString ( value ) ) {
22
- return parseStringStyle ( value )
24
+ return value
23
25
} else if ( isObject ( value ) ) {
24
26
return value
25
27
}
You can’t perform that action at this time.
0 commit comments