Skip to content

Commit 886103b

Browse files
committed
remove missed any cast
1 parent 1985cde commit 886103b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

editor/src/components/canvas/commands/utils/property-utils.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { modifyUnderlyingElementForOpenFile } from '../../../editor/store/editor
77
import { patchParseSuccessAtElementPath } from '../patch-utils'
88
import type { CSSNumber } from '../../../inspector/common/css-utils'
99
import { isCSSNumber } from '../../../inspector/common/css-utils'
10-
import type { StyleInfo, CSSStyleProperty } from '../../canvas-types'
10+
import { type StyleInfo, isStyleInfoKey } from '../../canvas-types'
1111

1212
export interface EditorStateWithPatch {
1313
editorStateWithChanges: EditorState
@@ -112,8 +112,11 @@ export function getCSSNumberFromStyleInfo(
112112
styleInfo: StyleInfo,
113113
property: string,
114114
): 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]
117120
if (prop == null || prop.type === 'not-found') {
118121
return { type: 'not-found' }
119122
}

0 commit comments

Comments
 (0)