import { IMatrixFunc } from '../../typings' ; import { DEFAULT_ACCURATE_DIGIT , DEFAULT_MATRIX_DIGIT , DEFAULT_SIZE_DIGIT } from '../const' ; import { stringifyFuncVal } from '../utils/stringify-funcval' ; import { shorten } from './shorten' ; export const stringify = ( m , digit1 = DEFAULT_MATRIX_DIGIT , digit2 = DEFAULT_SIZE_DIGIT , digit3 = DEFAULT_ACCURATE_DIGIT ) : string => { let result = '' ; m . forEach ( v => { const _v = shorten ( v , digit1 , digit2 , digit3 ) ; if ( ! _v . noEffect ) { result += `${ _v . type }(${ stringifyFuncVal ( _v . val ) })` ; } } ) ; return result ; } ;