mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-19 13:35:11 +00:00
18 lines
548 B
JavaScript
18 lines
548 B
JavaScript
import rgba from './rgba';
|
|
|
|
let separator = /\s*,\s*/;
|
|
export default function (props) {
|
|
let strokeDasharray = props.strokeDash || props.strokeDasharray;
|
|
|
|
if (typeof strokeDasharray === 'string') {
|
|
strokeDasharray = strokeDasharray.split(separator).map(dash => +dash);
|
|
}
|
|
|
|
return {
|
|
stroke: rgba(props.stroke, props.strokeOpacity),
|
|
strokeCap:props.strokeLinecap || props.strokeCap || 'square',
|
|
strokeJoin:props.strokeLinejoin || props.strokeJoin || 'miter',
|
|
strokeDash:strokeDasharray
|
|
};
|
|
}
|