11var reactProperty = require ( 'react-property' ) ;
22var utilities = require ( './utilities' ) ;
33
4- var setStyleProp = utilities . setStyleProp ;
5-
6- var htmlProperties = reactProperty . html ;
7- var svgProperties = reactProperty . svg ;
8- var isCustomAttribute = reactProperty . isCustomAttribute ;
9-
104var hasOwnProperty = Object . prototype . hasOwnProperty ;
115
126/**
@@ -28,15 +22,15 @@ function attributesToProps(attributes) {
2822 attributeValue = attributes [ attributeName ] ;
2923
3024 // ARIA (aria-*) or custom data (data-*) attribute
31- if ( isCustomAttribute ( attributeName ) ) {
25+ if ( reactProperty . isCustomAttribute ( attributeName ) ) {
3226 props [ attributeName ] = attributeValue ;
3327 continue ;
3428 }
3529
3630 // convert HTML attribute to React prop
3731 attributeNameLowerCased = attributeName . toLowerCase ( ) ;
38- if ( hasOwnProperty . call ( htmlProperties , attributeNameLowerCased ) ) {
39- property = htmlProperties [ attributeNameLowerCased ] ;
32+ if ( hasOwnProperty . call ( reactProperty . html , attributeNameLowerCased ) ) {
33+ property = reactProperty . html [ attributeNameLowerCased ] ;
4034 props [ property . propertyName ] =
4135 property . hasBooleanValue ||
4236 ( property . hasOverloadedBooleanValue && ! attributeValue )
@@ -46,8 +40,8 @@ function attributesToProps(attributes) {
4640 }
4741
4842 // convert SVG attribute to React prop
49- if ( hasOwnProperty . call ( svgProperties , attributeName ) ) {
50- property = svgProperties [ attributeName ] ;
43+ if ( hasOwnProperty . call ( reactProperty . svg , attributeName ) ) {
44+ property = reactProperty . svg [ attributeName ] ;
5145 props [ property . propertyName ] = attributeValue ;
5246 continue ;
5347 }
@@ -59,7 +53,7 @@ function attributesToProps(attributes) {
5953 }
6054
6155 // transform inline style to object
62- setStyleProp ( attributes . style , props ) ;
56+ utilities . setStyleProp ( attributes . style , props ) ;
6357
6458 return props ;
6559}
0 commit comments