MCPcopy
hub / github.com/vercel/satori / parsePolygon

Function parsePolygon

src/parser/shape.ts:113–141  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

resolveFillRuleFunction · 0.85
lengthToNumberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…