UNPKG
react-native-svg-animation-fix
Version:
latest (12.1.1)
12.1.1
SVG library for react-native
github.com/bardliu/react-native-svg
bardliu/react-native-svg
react-native-svg-animation-fix
/
src
/
lib
/
extract
/
extractPolyPoints.ts
10 lines
(8 loc)
•
283 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{
NumberProp
}
from
'./types'
;
export
default
function
extractPolyPoints
(
points: string | NumberProp[]
) {
const
polyPoints =
Array
.
isArray
(points) ? points.
join
(
','
) : points;
return
polyPoints .
replace
(
/[^e]-/
,
' -'
) .
split
(
/(?:\s+|\s*,\s*)/g
) .
join
(
' '
); }