From dbab230238b838578d91ef093320357b9c7faa8f Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Sun, 20 Oct 2019 18:47:56 +0300 Subject: [PATCH] refactor: expose SvgCss, SvgCssUri, inlineStyles simplify CSSStyleDeclaration --- src/ReactNativeSVG.ts | 4 ++++ src/css.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ReactNativeSVG.ts b/src/ReactNativeSVG.ts index 7ed17fd94..f7b633412 100644 --- a/src/ReactNativeSVG.ts +++ b/src/ReactNativeSVG.ts @@ -23,6 +23,7 @@ import Pattern, { RNSVGPattern } from './elements/Pattern'; import Mask, { RNSVGMask } from './elements/Mask'; import Marker, { RNSVGMarker } from './elements/Marker'; import { parse, SvgAst, SvgFromUri, SvgFromXml, SvgUri, SvgXml } from './xml'; +import { SvgCss, SvgCssUri, inlineStyles } from './css'; export { Svg, @@ -54,6 +55,9 @@ export { SvgFromXml, SvgUri, SvgXml, + SvgCss, + SvgCssUri, + inlineStyles, Shape, RNSVGMarker, RNSVGMask, diff --git a/src/css.js b/src/css.js index 3e1c5eb1e..7314657be 100644 --- a/src/css.js +++ b/src/css.js @@ -315,7 +315,7 @@ function getCssStr(element) { return element.children || []; } -const CSSStyleDeclaration = function(node) { +function CSSStyleDeclaration(node) { this.style = node.props.style; this.properties = new Map(); const { styles } = node; @@ -350,7 +350,7 @@ const CSSStyleDeclaration = function(node) { } } }); -}; +} CSSStyleDeclaration.prototype.getProperty = function(propertyName) { if (typeof propertyName === 'undefined') {