File tree 1 file changed +6
-3
lines changed
editor/src/components/canvas/commands/utils
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { modifyUnderlyingElementForOpenFile } from '../../../editor/store/editor
7
7
import { patchParseSuccessAtElementPath } from '../patch-utils'
8
8
import type { CSSNumber } from '../../../inspector/common/css-utils'
9
9
import { isCSSNumber } from '../../../inspector/common/css-utils'
10
- import type { StyleInfo , CSSStyleProperty } from '../../canvas-types'
10
+ import { type StyleInfo , isStyleInfoKey } from '../../canvas-types'
11
11
12
12
export interface EditorStateWithPatch {
13
13
editorStateWithChanges : EditorState
@@ -112,8 +112,11 @@ export function getCSSNumberFromStyleInfo(
112
112
styleInfo : StyleInfo ,
113
113
property : string ,
114
114
) : GetCSSNumberFromStyleInfoResult {
115
- let styleInfoUntyped = styleInfo as any as Record < string , CSSStyleProperty < unknown > >
116
- const prop = styleInfoUntyped [ property ]
115
+ if ( ! isStyleInfoKey ( property ) ) {
116
+ return { type : 'not-found' }
117
+ }
118
+
119
+ const prop = styleInfo [ property ]
117
120
if ( prop == null || prop . type === 'not-found' ) {
118
121
return { type : 'not-found' }
119
122
}
You can’t perform that action at this time.
0 commit comments