/**
 * Numbers used to check a document or something containing numbers.
 */ type CheckSums = [ number , number ] ; param numbers param validators const generateCheckSums = ( numbers , validators ) : CheckSums => { const initialCheckSums = [ 0 , 0 ] ; return validators . reduce ( ( [ checkerA , checkerB ] , validator , index ) => [ ( index === 0 ) ? 0 : ( checkerA + numbers [ index - 1 ] * validator ) , checkerB + numbers [ index ] * validator ] as CheckSums , initialCheckSums ) ; } ; export default generateCheckSums ;