param { string } str param { number } len returns { string } function padZeros ( str , len ) { str = str . substring ( 0 , len ) ; for ( let i = len - str . length ; i > 0 ; -- i ) { str = '0' + str ; } return str ; } param { string } version returns { string } export function normalize ( version ) { const versionAndLabel = version . split ( '-' ) ; const parts = versionAndLabel [ 0 ] . split ( '.' ) ; return [ padZeros ( parts [ 0 ] , 2 ) , padZeros ( parts [ 1 ] , 3 ) , padZeros ( parts [ 2 ] , 3 ) ] . join ( '' ) ; }