param array export function convertStr2Num ( array = [ ] ) { let result = [ ] ; array . forEach ( item => { result . push ( Math . round ( Number ( item ) ) ) ; } ) ; return result ; } param array param size export function chunk ( array , size ) { if ( array . length < size ) return array ; let result = [ ] ; for ( let i = 0 ; i < array . length ; i += size ) { result . push ( array . slice ( i , i + size ) ) ; } return result ; } param array param baseCordinate export function getAbsoluteCordinate ( array , baseCordinate ) { let result = [ ] ; array . forEach ( ( cordinate , index ) => { if ( index === 0 ) { result . push ( [ cordinate [ 0 ] + baseCordinate . x , cordinate [ 1 ] + baseCordinate . y ] ) ; } else { result . push ( [ cordinate [ 0 ] + result [ index - 1 ] [ 0 ] , cordinate [ 1 ] + result [ index - 1 ] [ 1 ] ] ) ; } } ) ; return result ; }