(style: StyleMap)
| 283 | } |
| 284 | |
| 285 | function getBorderWidth(style: StyleMap): string | null { |
| 286 | const sideWidths = BORDER_SIDES.map((side) => { |
| 287 | const width = style[`border-${side}-width`] |
| 288 | if (width) return normalizeStyleValue(width) |
| 289 | const border = style[`border-${side}`] |
| 290 | if (!border) return null |
| 291 | const parsed = parseBorderShorthand(normalizeStyleValue(border)) |
| 292 | return parsed.width ? normalizeStyleValue(parsed.width) : null |
| 293 | }) |
| 294 | |
| 295 | if (sideWidths.every((width): width is string => typeof width === 'string' && width.length > 0)) { |
| 296 | const [first, ...rest] = sideWidths |
| 297 | if (rest.every((width) => width === first)) { |
| 298 | return first |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | const borderWidth = style['border-width'] |
| 303 | if (borderWidth) { |
| 304 | const [t, r, b, l] = parseBoxValues(normalizeStyleValue(borderWidth)) |
| 305 | if (t === r && r === b && b === l) return t |
| 306 | } |
| 307 | |
| 308 | if (style.border) { |
| 309 | const parsed = parseBorderShorthand(normalizeStyleValue(style.border)) |
| 310 | if (parsed.width) return normalizeStyleValue(parsed.width) |
| 311 | } |
| 312 | |
| 313 | return null |
| 314 | } |
| 315 | |
| 316 | function hasOverflowClipping(style: StyleMap): boolean { |
| 317 | const overflowValues = [style.overflow, style['overflow-x'], style['overflow-y']] |
no test coverage detected