react-native-svg
Version:
SVG library for react-native
12 lines (10 loc) • 315 B
text/typescript
import type { NumberProp } from './types';
export default function extractPolyPoints(
points: string | readonly NumberProp[],
) {
const polyPoints = Array.isArray(points) ? points.join(',') : points;
return (polyPoints as string)
.replace(/[^eE]-/, ' -')
.split(/(?:\s+|\s*,\s*)/g)
.join(' ');
}