export type FlexParts = [ string , string , string ] ; export function partsToStyle ( parts ) { const [ grow , shrink , basis ] = parts ; return `${ grow } ${ shrink } ${ basis }` ; } export function basisToParts ( grow , shrink , flexBasis ) { const parts = flexBasis . split ( ' ' ) ; if ( parts . length === 3 ) { return parts as FlexParts ; } return [ grow , shrink , flexBasis ] ; }