File tree Expand file tree Collapse file tree 4 files changed +36
-15
lines changed
Expand file tree Collapse file tree 4 files changed +36
-15
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,19 @@ export const deprecateInnerBlockRowGapAndContainerHeight = {
2929 const getAttrName = getAttrNameFunction ( attrNameTemplate )
3030 const getAttribute = _attrName => attributes [ getAttrName ( _attrName ) ]
3131
32+ const newAttributes = {
33+ ...attributes ,
34+ }
35+
3236 const containerHeight = getAttribute ( 'containerHeight' )
3337 const innerBlockRowGap = getAttribute ( 'innerBlockRowGap' )
3438
35- const newAttributes = {
36- ...attributes ,
37- [ getAttrName ( 'containerHeight' ) ] : String ( containerHeight ) ,
38- [ getAttrName ( 'innerBlockRowGap' ) ] : String ( innerBlockRowGap ) ,
39+ if ( typeof containerHeight === 'number' ) {
40+ newAttributes [ getAttrName ( 'containerHeight' ) ] = String ( containerHeight )
41+ }
42+
43+ if ( typeof innerBlockRowGap === 'number' ) {
44+ newAttributes [ getAttrName ( 'innerBlockRowGap' ) ] = String ( innerBlockRowGap )
3945 }
4046
4147 return newAttributes
Original file line number Diff line number Diff line change @@ -41,15 +41,24 @@ export const deprecateColumnAndRowGap = {
4141 const getAttrName = getAttrNameFunction ( attrNameTemplate )
4242 const getAttribute = _attrName => attributes [ getAttrName ( _attrName ) ]
4343
44+ const newAttributes = {
45+ ...attributes ,
46+ }
47+
4448 const columnSpacing = getAttribute ( 'columnSpacing' )
4549 const columnGap = getAttribute ( 'columnGap' )
4650 const rowGap = getAttribute ( 'rowGap' )
4751
48- const newAttributes = {
49- ...attributes ,
50- [ getAttrName ( 'columnSpacing' ) ] : String ( columnSpacing ) ,
51- [ getAttrName ( 'columnGap' ) ] : String ( columnGap ) ,
52- [ getAttrName ( 'rowGap' ) ] : String ( rowGap ) ,
52+ if ( typeof columnSpacing === 'number' ) {
53+ newAttributes [ getAttrName ( 'columnSpacing' ) ] = String ( columnSpacing )
54+ }
55+
56+ if ( typeof columnGap === 'number' ) {
57+ newAttributes [ getAttrName ( 'columnGap' ) ] = String ( columnGap )
58+ }
59+
60+ if ( typeof rowGap === 'number' ) {
61+ newAttributes [ getAttrName ( 'rowGap' ) ] = String ( rowGap )
5362 }
5463
5564 return newAttributes
Original file line number Diff line number Diff line change @@ -29,11 +29,14 @@ export const deprecateSizeControlHeight = {
2929 const getAttrName = getAttrNameFunction ( attrNameTemplate )
3030 const getAttribute = _attrName => attributes [ getAttrName ( _attrName ) ]
3131
32- const height = getAttribute ( 'height' )
33-
3432 const newAttributes = {
3533 ...attributes ,
36- [ getAttrName ( 'height' ) ] : String ( height ) ,
34+ }
35+
36+ const height = getAttribute ( 'height' )
37+
38+ if ( typeof height === 'number' ) {
39+ newAttributes [ getAttrName ( 'height' ) ] = String ( height )
3740 }
3841
3942 return newAttributes
Original file line number Diff line number Diff line change @@ -130,11 +130,14 @@ export const deprecateTypographyFontSize = {
130130 const getAttrName = getAttrNameFunction ( attrNameTemplate )
131131 const getAttribute = _attrName => attributes [ getAttrName ( _attrName ) ]
132132
133- const fontSize = getAttribute ( 'fontSize' )
134-
135133 const newAttributes = {
136134 ...attributes ,
137- [ getAttrName ( 'fontSize' ) ] : String ( fontSize ) ,
135+ }
136+
137+ const fontSize = getAttribute ( 'fontSize' )
138+
139+ if ( typeof fontSize === 'number' ) {
140+ newAttributes [ getAttrName ( 'fontSize' ) ] = String ( fontSize )
138141 }
139142
140143 return newAttributes
You can’t perform that action at this time.
0 commit comments