import { SKLayer , PanelOptions , Property } from '../types' ; import { precisionControl } from '../common/utils' ; param layer export const parseProperty = ( layer ) : Property => { const { frame , name , style , points , _class , symbolName = '' , sharedLayerStyleName = '' , sharedTextStyleName = '' } = layer ; return { name , position : { x : frame . x , y : frame . y , } , size : { width : frame . width , height : frame . height , } , opacity : precisionControl ( style . contextSettings ?. opacity , 0.01 ) , radius : _class === 'rectangle' && points . length === 4 ? points . map ( ( { cornerRadius } ) => + cornerRadius ) : [ 0 , 0 , 0 , 0 ] , symbolName , sharedLayerStyleName , sharedTextStyleName , } ; } ;