UNPKG

@ice/jsx-runtime

Version:

JSX runtime for ice.

22 lines (21 loc) 658 B
// @ts-ignore import { convertUnit } from "style-unit"; var STYLE = "style"; function isObject(obj) { return typeof obj === "object"; } // Support rpx unit. export function hijackElementProps(props) { if (props && STYLE in props) { var style = props.style; if (isObject(style)) { var result = Object.assign({}, props); var convertedStyle = {}; for(var prop in style)// @ts-ignore convertedStyle[prop] = typeof style[prop] === "string" ? convertUnit(style[prop]) : style[prop]; result["style"] = convertedStyle; return result; } } return props; }