mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 09:27:20 +00:00
Add function names for default exports
This commit is contained in:
@@ -2,7 +2,7 @@ import Color from "color";
|
||||
|
||||
const urlIdPattern = /^url\(#(.+?)\)$/;
|
||||
|
||||
export default function(colorOrBrush) {
|
||||
export default function extractBrush(colorOrBrush) {
|
||||
if (colorOrBrush === "none" || !colorOrBrush) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ const clipRules = {
|
||||
nonzero: 1,
|
||||
};
|
||||
|
||||
export default function(props) {
|
||||
export default function extractClipPath(props) {
|
||||
const { clipPath, clipRule } = props;
|
||||
const clipPathProps = {};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ const fillRules = {
|
||||
|
||||
const fillProps = ["fill", "fillOpacity", "fillRule"];
|
||||
|
||||
export default function(props, styleProperties) {
|
||||
export default function extractFill(props, styleProperties) {
|
||||
for (const name of fillProps) {
|
||||
if (props.hasOwnProperty(name)) {
|
||||
styleProperties.push(name);
|
||||
|
||||
@@ -24,7 +24,7 @@ function percentToFloat(percent) {
|
||||
|
||||
const offsetComparator = (object, other) => object[0] - other[0];
|
||||
|
||||
export default function(props) {
|
||||
export default function extractGradient(props) {
|
||||
const { id, children, gradientTransform, transform, gradientUnits } = props;
|
||||
if (!id) {
|
||||
return null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const spaceReg = /\s+/;
|
||||
const commaReg = /,/g;
|
||||
|
||||
export default function(lengthList) {
|
||||
export default function extractLengthList(lengthList) {
|
||||
if (Array.isArray(lengthList)) {
|
||||
return lengthList;
|
||||
} else if (typeof lengthList === "number") {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default function(opacity) {
|
||||
export default function extractOpacity(opacity) {
|
||||
const value = +opacity;
|
||||
return typeof value !== "number" || isNaN(value) ? 1 : value;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default function(points) {
|
||||
export default function extractPolyPoints(points) {
|
||||
const polyPoints = Array.isArray(points) ? points.join(",") : points;
|
||||
return polyPoints
|
||||
.replace(/[^e]-/, " -")
|
||||
|
||||
@@ -6,7 +6,7 @@ import extractResponder from "./extractResponder";
|
||||
import extractOpacity from "./extractOpacity";
|
||||
import { idPattern } from "../util";
|
||||
|
||||
export default function(prop, ref) {
|
||||
export default function extractProps(prop, ref) {
|
||||
const props = { ...prop.style, ...prop };
|
||||
const { opacity, onLayout, id, clipPath, mask } = props;
|
||||
const styleProperties = [];
|
||||
|
||||
@@ -25,7 +25,7 @@ function hasTouchableProperty(props) {
|
||||
return false;
|
||||
}
|
||||
|
||||
export default function(props, ref) {
|
||||
export default function extractResponder(props, ref) {
|
||||
const extractedProps = {};
|
||||
|
||||
for (const key of responderProps) {
|
||||
|
||||
@@ -25,7 +25,7 @@ const strokeProps = [
|
||||
"strokeMiterlimit",
|
||||
];
|
||||
|
||||
export default function(props, styleProperties) {
|
||||
export default function extractStroke(props, styleProperties) {
|
||||
for (const name of strokeProps) {
|
||||
if (props.hasOwnProperty(name)) {
|
||||
styleProperties.push(name);
|
||||
|
||||
@@ -97,7 +97,7 @@ function getChild(child) {
|
||||
}
|
||||
}
|
||||
|
||||
export default function(props, container = false) {
|
||||
export default function extractText(props, container = false) {
|
||||
const {
|
||||
x,
|
||||
y,
|
||||
|
||||
@@ -104,7 +104,7 @@ export function props2transform(props) {
|
||||
};
|
||||
}
|
||||
|
||||
export default function(props) {
|
||||
export default function extractTransform(props) {
|
||||
return transformToMatrix(
|
||||
props2transform(props),
|
||||
props.transform ? props2transform(props.transform) : null,
|
||||
|
||||
@@ -22,7 +22,7 @@ export const alignEnum = [
|
||||
|
||||
const spacesRegExp = /\s+/;
|
||||
|
||||
export default function(props) {
|
||||
export default function extractViewBox(props) {
|
||||
const { viewBox, preserveAspectRatio } = props;
|
||||
|
||||
if (!viewBox) {
|
||||
|
||||
Reference in New Issue
Block a user