1- /* @flow */
2-
3- function isSimplePositionValue ( value : any ) {
1+ function isSimplePositionValue ( value ) {
42 return typeof value === 'number' && ! isNaN ( value )
53}
64
7- function isComplexSpanValue ( value : string ) {
5+ function isComplexSpanValue ( value ) {
86 return typeof value === 'string' && value . includes ( '/' )
97}
108
@@ -16,13 +14,13 @@ const displayValues = {
1614}
1715
1816const propertyConverters = {
19- alignSelf : ( value : any , style : Object ) => {
17+ alignSelf : ( value , style ) => {
2018 if ( alignmentValues . indexOf ( value ) > - 1 ) {
2119 style . msGridRowAlign = value
2220 }
2321 } ,
2422
25- gridColumn : ( value : any , style : Object ) => {
23+ gridColumn : ( value , style ) => {
2624 if ( isSimplePositionValue ( value ) ) {
2725 style . msGridColumn = value
2826 } else if ( isComplexSpanValue ( value ) ) {
@@ -40,20 +38,20 @@ const propertyConverters = {
4038 }
4139 } ,
4240
43- gridColumnEnd: ( value : any , style : Object ) => {
41+ gridColumnEnd : ( value , style ) => {
4442 const { msGridColumn } = style
4543 if ( isSimplePositionValue ( value ) && isSimplePositionValue ( msGridColumn ) ) {
4644 style . msGridColumnSpan = value - msGridColumn
4745 }
4846 } ,
4947
50- gridColumnStart : ( value : any , style : Object ) = > {
48+ gridColumnStart : ( value , style ) => {
5149 if ( isSimplePositionValue ( value ) ) {
5250 style . msGridColumn = value
5351 }
5452 } ,
5553
56- gridRow : ( value : any , style : Object ) = > {
54+ gridRow : ( value , style ) => {
5755 if ( isSimplePositionValue ( value ) ) {
5856 style . msGridRow = value
5957 } else if ( isComplexSpanValue ( value ) ) {
@@ -71,39 +69,35 @@ const propertyConverters = {
7169 }
7270 } ,
7371
74- gridRowEnd: ( value : any , style : Object ) => {
72+ gridRowEnd : ( value , style ) => {
7573 const { msGridRow } = style
7674 if ( isSimplePositionValue ( value ) && isSimplePositionValue ( msGridRow ) ) {
7775 style . msGridRowSpan = value - msGridRow
7876 }
7977 } ,
8078
81- gridRowStart : ( value : any , style : Object ) = > {
79+ gridRowStart : ( value , style ) => {
8280 if ( isSimplePositionValue ( value ) ) {
8381 style . msGridRow = value
8482 }
8583 } ,
8684
87- gridTemplateColumns : ( value : any , style : Object ) = > {
85+ gridTemplateColumns : ( value , style ) => {
8886 style . msGridColumns = value
8987 } ,
9088
91- gridTemplateRows : ( value : any , style : Object ) => {
89+ gridTemplateRows : ( value , style ) => {
9290 style . msGridRows = value
9391 } ,
9492
95- justifySelf : ( value : any , style : Object ) = > {
93+ justifySelf : ( value , style ) => {
9694 if ( alignmentValues . indexOf ( value ) > - 1 ) {
9795 style . msGridColumnAlign = value
9896 }
9997 } ,
10098}
10199
102- export default function grid (
103- property : string ,
104- value : any ,
105- style : Object
106- ) : ?Array < string > {
100+ export default function grid ( property , value , style ) {
107101 if ( property === 'display' && value in displayValues ) {
108102 return displayValues [ value ]
109103 }
0 commit comments