(str: string)
| 111 | } |
| 112 | } |
| 113 | function parsePolygon(str: string) { |
| 114 | const res = str.match(regexMap['polygon']) |
| 115 | |
| 116 | if (!res) return null |
| 117 | |
| 118 | const [fillRule, points] = resolveFillRule(res[1]) |
| 119 | |
| 120 | return { |
| 121 | type: 'polygon', |
| 122 | 'fill-rule': fillRule, |
| 123 | points: points |
| 124 | .split(',') |
| 125 | .map((v) => |
| 126 | v |
| 127 | .split(' ') |
| 128 | .map((k, i) => |
| 129 | lengthToNumber( |
| 130 | k, |
| 131 | inheritedStyle.fontSize as number, |
| 132 | i === 0 ? width : height, |
| 133 | inheritedStyle, |
| 134 | true |
| 135 | ) |
| 136 | ) |
| 137 | .join(' ') |
| 138 | ) |
| 139 | .join(','), |
| 140 | } |
| 141 | } |
| 142 | function parseInset(str: string) { |
| 143 | const res = str.match(regexMap['inset']) |
| 144 |
nothing calls this directly
no test coverage detected
searching dependent graphs…