import { getColors, getMeasurements } from '../properties'; import { Token } from '../../../types/Token'; import { StyleBorderRule } from '../../../types/style/StyleBorderRule'; import { StylePropertyType } from '../../../types/style/StylePropertyType'; export function parseBorder( symbols: Token[] ): StyleBorderRule | null { const colors = getColors( symbols ); const measurements = getMeasurements( symbols ); if( colors.length === 0 && measurements.length === 0 ) return null; return { type: StylePropertyType.Border, color: colors.length ? colors[ 0 ] : undefined, width: measurements.length > 0 ? measurements[ 0 ] : '1px' } }