@@ -94,10 +94,11 @@ export default function r2wc<Props, Context>(
94
94
const attribute = mapPropAttribute [ prop ]
95
95
const value = this . getAttribute ( attribute )
96
96
const type = propTypes [ prop ]
97
+ const transform = transforms [ type ]
97
98
98
- if ( value ) {
99
+ if ( value && transform ?. parse ) {
99
100
//@ts -ignore
100
- this [ propsSymbol ] [ prop ] = transforms [ type ] . parse ( value , this )
101
+ this [ propsSymbol ] [ prop ] = transform . parse ( value , this )
101
102
}
102
103
}
103
104
}
@@ -122,10 +123,11 @@ export default function r2wc<Props, Context>(
122
123
) {
123
124
const prop = mapAttributeProp [ attribute ]
124
125
const type = propTypes [ prop ]
126
+ const transform = transforms [ type ]
125
127
126
- if ( prop in propTypes ) {
128
+ if ( prop in propTypes && transform ?. parse ) {
127
129
//@ts -ignore
128
- this [ propsSymbol ] [ prop ] = transforms [ type ] . parse ( value , this )
130
+ this [ propsSymbol ] [ prop ] = transform . parse ( value , this )
129
131
130
132
this [ renderSymbol ] ( )
131
133
}
@@ -159,10 +161,10 @@ export default function r2wc<Props, Context>(
159
161
set ( value ) {
160
162
this [ propsSymbol ] [ prop ] = value
161
163
162
- const stringify = transforms [ type ] . stringify
163
- if ( stringify ) {
164
+ const transform = transforms [ type ]
165
+ if ( transform ?. stringify ) {
164
166
//@ts -ignore
165
- const attributeValue = stringify ( value )
167
+ const attributeValue = transform . stringify ( value )
166
168
const oldAttributeValue = this . getAttribute ( attribute )
167
169
168
170
if ( oldAttributeValue !== attributeValue ) {
0 commit comments